diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index c16bdcc..d616b97 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -31,6 +31,7 @@ docs/CreateSettingInitialValues.md docs/CreateTagModel.md docs/DeleteIntegrationLinkModel.md docs/DeleteRepositoryReportsRequest.md +docs/DeletedSettingModel.md docs/EnvironmentAccessModel.md docs/EnvironmentAccessType.md docs/EnvironmentModel.md @@ -81,8 +82,10 @@ docs/PrerequisiteFlagConditionModel.md docs/ProductModel.md docs/ProductsApi.md docs/ReasonRequiredEnvironmentModel.md -docs/ReferenceLine.md -docs/ReferenceLines.md +docs/ReferenceLineModel.md +docs/ReferenceLineRequest.md +docs/ReferenceLinesModel.md +docs/ReferenceLinesRequest.md docs/ReplaceSettingModel.md docs/RolloutPercentageItemModel.md docs/RolloutRuleComparator.md @@ -100,36 +103,58 @@ docs/SettingModel.md docs/SettingTagModel.md docs/SettingType.md docs/SettingValueModel.md +docs/SettingValueType.md +docs/StaleFlagConfigModel.md +docs/StaleFlagEnvironmentModel.md +docs/StaleFlagProductModel.md +docs/StaleFlagReminderScope.md +docs/StaleFlagSettingModel.md +docs/StaleFlagSettingTagModel.md +docs/StaleFlagSettingValueModel.md +docs/StaleFlagStaleInEnvironmentsType.md docs/TagModel.md docs/TagsApi.md docs/TargetingRuleModel.md +docs/UpdateComparisonValueListModel.md +docs/UpdateComparisonValueModel.md +docs/UpdateConditionModel.md docs/UpdateConfigRequest.md docs/UpdateEnvironmentModel.md docs/UpdateEvaluationFormulaModel.md docs/UpdateEvaluationFormulaWithIdModel.md docs/UpdateEvaluationFormulasModel.md docs/UpdateMemberPermissionsRequest.md +docs/UpdatePercentageOptionModel.md docs/UpdatePermissionGroupRequest.md docs/UpdatePreferencesRequest.md +docs/UpdatePrerequisiteFlagConditionModel.md docs/UpdateProductRequest.md docs/UpdateReasonRequiredEnvironmentModel.md +docs/UpdateRolloutPercentageItemModel.md +docs/UpdateRolloutRuleModel.md +docs/UpdateSegmentConditionModel.md docs/UpdateSegmentModel.md docs/UpdateSettingValueModel.md docs/UpdateSettingValueWithSettingIdModel.md docs/UpdateSettingValuesWithIdModel.md docs/UpdateTagModel.md +docs/UpdateTargetingRuleModel.md +docs/UpdateUserConditionModel.md +docs/UpdateValueModel.md docs/UserComparator.md docs/UserConditionModel.md docs/UserModel.md docs/ValueModel.md docs/WebHookHttpMethod.md -docs/WebHookRequest.md +docs/WebHookRequestModel.md docs/WebhookConfig.md docs/WebhookEnvironment.md docs/WebhookHeaderModel.md -docs/WebhookModel.md +docs/WebhookHeaderResponseModel.md +docs/WebhookResponseModel.md docs/WebhookSigningKeysModel.md docs/WebhooksApi.md +docs/ZombieStaleFlagsApi.md git_push.sh gradle.properties gradle/wrapper/gradle-wrapper.jar @@ -171,6 +196,7 @@ src/main/java/com/configcat/publicapi/java/client/api/SdkKeysApi.java src/main/java/com/configcat/publicapi/java/client/api/SegmentsApi.java src/main/java/com/configcat/publicapi/java/client/api/TagsApi.java src/main/java/com/configcat/publicapi/java/client/api/WebhooksApi.java +src/main/java/com/configcat/publicapi/java/client/api/ZombieStaleFlagsApi.java src/main/java/com/configcat/publicapi/java/client/auth/ApiKeyAuth.java src/main/java/com/configcat/publicapi/java/client/auth/Authentication.java src/main/java/com/configcat/publicapi/java/client/auth/HttpBasicAuth.java @@ -203,6 +229,7 @@ src/main/java/com/configcat/publicapi/java/client/model/CreateSettingInitialValu src/main/java/com/configcat/publicapi/java/client/model/CreateTagModel.java src/main/java/com/configcat/publicapi/java/client/model/DeleteIntegrationLinkModel.java src/main/java/com/configcat/publicapi/java/client/model/DeleteRepositoryReportsRequest.java +src/main/java/com/configcat/publicapi/java/client/model/DeletedSettingModel.java src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessModel.java src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessType.java src/main/java/com/configcat/publicapi/java/client/model/EnvironmentModel.java @@ -240,8 +267,10 @@ src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteComparator.j src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteFlagConditionModel.java src/main/java/com/configcat/publicapi/java/client/model/ProductModel.java src/main/java/com/configcat/publicapi/java/client/model/ReasonRequiredEnvironmentModel.java -src/main/java/com/configcat/publicapi/java/client/model/ReferenceLine.java -src/main/java/com/configcat/publicapi/java/client/model/ReferenceLines.java +src/main/java/com/configcat/publicapi/java/client/model/ReferenceLineModel.java +src/main/java/com/configcat/publicapi/java/client/model/ReferenceLineRequest.java +src/main/java/com/configcat/publicapi/java/client/model/ReferenceLinesModel.java +src/main/java/com/configcat/publicapi/java/client/model/ReferenceLinesRequest.java src/main/java/com/configcat/publicapi/java/client/model/ReplaceSettingModel.java src/main/java/com/configcat/publicapi/java/client/model/RolloutPercentageItemModel.java src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleComparator.java @@ -257,31 +286,52 @@ src/main/java/com/configcat/publicapi/java/client/model/SettingModel.java src/main/java/com/configcat/publicapi/java/client/model/SettingTagModel.java src/main/java/com/configcat/publicapi/java/client/model/SettingType.java src/main/java/com/configcat/publicapi/java/client/model/SettingValueModel.java +src/main/java/com/configcat/publicapi/java/client/model/SettingValueType.java +src/main/java/com/configcat/publicapi/java/client/model/StaleFlagConfigModel.java +src/main/java/com/configcat/publicapi/java/client/model/StaleFlagEnvironmentModel.java +src/main/java/com/configcat/publicapi/java/client/model/StaleFlagProductModel.java +src/main/java/com/configcat/publicapi/java/client/model/StaleFlagReminderScope.java +src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingModel.java +src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingTagModel.java +src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingValueModel.java +src/main/java/com/configcat/publicapi/java/client/model/StaleFlagStaleInEnvironmentsType.java src/main/java/com/configcat/publicapi/java/client/model/TagModel.java src/main/java/com/configcat/publicapi/java/client/model/TargetingRuleModel.java +src/main/java/com/configcat/publicapi/java/client/model/UpdateComparisonValueListModel.java +src/main/java/com/configcat/publicapi/java/client/model/UpdateComparisonValueModel.java +src/main/java/com/configcat/publicapi/java/client/model/UpdateConditionModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateConfigRequest.java src/main/java/com/configcat/publicapi/java/client/model/UpdateEnvironmentModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaWithIdModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulasModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateMemberPermissionsRequest.java +src/main/java/com/configcat/publicapi/java/client/model/UpdatePercentageOptionModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdatePermissionGroupRequest.java src/main/java/com/configcat/publicapi/java/client/model/UpdatePreferencesRequest.java +src/main/java/com/configcat/publicapi/java/client/model/UpdatePrerequisiteFlagConditionModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateProductRequest.java src/main/java/com/configcat/publicapi/java/client/model/UpdateReasonRequiredEnvironmentModel.java +src/main/java/com/configcat/publicapi/java/client/model/UpdateRolloutPercentageItemModel.java +src/main/java/com/configcat/publicapi/java/client/model/UpdateRolloutRuleModel.java +src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentConditionModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueWithSettingIdModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValuesWithIdModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateTagModel.java +src/main/java/com/configcat/publicapi/java/client/model/UpdateTargetingRuleModel.java +src/main/java/com/configcat/publicapi/java/client/model/UpdateUserConditionModel.java +src/main/java/com/configcat/publicapi/java/client/model/UpdateValueModel.java src/main/java/com/configcat/publicapi/java/client/model/UserComparator.java src/main/java/com/configcat/publicapi/java/client/model/UserConditionModel.java src/main/java/com/configcat/publicapi/java/client/model/UserModel.java src/main/java/com/configcat/publicapi/java/client/model/ValueModel.java src/main/java/com/configcat/publicapi/java/client/model/WebHookHttpMethod.java -src/main/java/com/configcat/publicapi/java/client/model/WebHookRequest.java +src/main/java/com/configcat/publicapi/java/client/model/WebHookRequestModel.java src/main/java/com/configcat/publicapi/java/client/model/WebhookConfig.java src/main/java/com/configcat/publicapi/java/client/model/WebhookEnvironment.java src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderModel.java -src/main/java/com/configcat/publicapi/java/client/model/WebhookModel.java +src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderResponseModel.java +src/main/java/com/configcat/publicapi/java/client/model/WebhookResponseModel.java src/main/java/com/configcat/publicapi/java/client/model/WebhookSigningKeysModel.java diff --git a/README.md b/README.md index ad273c8..c5aa46a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ConfigCat Public Management API - API version: v1 - - Build date: 2025-02-20T16:55:24.304297906Z[Etc/UTC] + - Build date: 2025-06-10T21:25:35.532049258Z[Etc/UTC] - Generator version: 7.7.0 The purpose of this API is to access the ConfigCat platform programmatically. @@ -253,6 +253,7 @@ Class | Method | HTTP request | Description *WebhooksApi* | [**getWebhooks**](docs/WebhooksApi.md#getWebhooks) | **GET** /v1/products/{productId}/webhooks | List Webhooks *WebhooksApi* | [**replaceWebhook**](docs/WebhooksApi.md#replaceWebhook) | **PUT** /v1/webhooks/{webhookId} | Replace Webhook *WebhooksApi* | [**updateWebhook**](docs/WebhooksApi.md#updateWebhook) | **PATCH** /v1/webhooks/{webhookId} | Update Webhook +*ZombieStaleFlagsApi* | [**getStaleflags**](docs/ZombieStaleFlagsApi.md#getStaleflags) | **GET** /v1/products/{productId}/staleflags | List Zombie (stale) flags for Product ## Documentation for Models @@ -284,6 +285,7 @@ Class | Method | HTTP request | Description - [CreateTagModel](docs/CreateTagModel.md) - [DeleteIntegrationLinkModel](docs/DeleteIntegrationLinkModel.md) - [DeleteRepositoryReportsRequest](docs/DeleteRepositoryReportsRequest.md) + - [DeletedSettingModel](docs/DeletedSettingModel.md) - [EnvironmentAccessModel](docs/EnvironmentAccessModel.md) - [EnvironmentAccessType](docs/EnvironmentAccessType.md) - [EnvironmentModel](docs/EnvironmentModel.md) @@ -321,8 +323,10 @@ Class | Method | HTTP request | Description - [PrerequisiteFlagConditionModel](docs/PrerequisiteFlagConditionModel.md) - [ProductModel](docs/ProductModel.md) - [ReasonRequiredEnvironmentModel](docs/ReasonRequiredEnvironmentModel.md) - - [ReferenceLine](docs/ReferenceLine.md) - - [ReferenceLines](docs/ReferenceLines.md) + - [ReferenceLineModel](docs/ReferenceLineModel.md) + - [ReferenceLineRequest](docs/ReferenceLineRequest.md) + - [ReferenceLinesModel](docs/ReferenceLinesModel.md) + - [ReferenceLinesRequest](docs/ReferenceLinesRequest.md) - [ReplaceSettingModel](docs/ReplaceSettingModel.md) - [RolloutPercentageItemModel](docs/RolloutPercentageItemModel.md) - [RolloutRuleComparator](docs/RolloutRuleComparator.md) @@ -338,33 +342,54 @@ Class | Method | HTTP request | Description - [SettingTagModel](docs/SettingTagModel.md) - [SettingType](docs/SettingType.md) - [SettingValueModel](docs/SettingValueModel.md) + - [SettingValueType](docs/SettingValueType.md) + - [StaleFlagConfigModel](docs/StaleFlagConfigModel.md) + - [StaleFlagEnvironmentModel](docs/StaleFlagEnvironmentModel.md) + - [StaleFlagProductModel](docs/StaleFlagProductModel.md) + - [StaleFlagReminderScope](docs/StaleFlagReminderScope.md) + - [StaleFlagSettingModel](docs/StaleFlagSettingModel.md) + - [StaleFlagSettingTagModel](docs/StaleFlagSettingTagModel.md) + - [StaleFlagSettingValueModel](docs/StaleFlagSettingValueModel.md) + - [StaleFlagStaleInEnvironmentsType](docs/StaleFlagStaleInEnvironmentsType.md) - [TagModel](docs/TagModel.md) - [TargetingRuleModel](docs/TargetingRuleModel.md) + - [UpdateComparisonValueListModel](docs/UpdateComparisonValueListModel.md) + - [UpdateComparisonValueModel](docs/UpdateComparisonValueModel.md) + - [UpdateConditionModel](docs/UpdateConditionModel.md) - [UpdateConfigRequest](docs/UpdateConfigRequest.md) - [UpdateEnvironmentModel](docs/UpdateEnvironmentModel.md) - [UpdateEvaluationFormulaModel](docs/UpdateEvaluationFormulaModel.md) - [UpdateEvaluationFormulaWithIdModel](docs/UpdateEvaluationFormulaWithIdModel.md) - [UpdateEvaluationFormulasModel](docs/UpdateEvaluationFormulasModel.md) - [UpdateMemberPermissionsRequest](docs/UpdateMemberPermissionsRequest.md) + - [UpdatePercentageOptionModel](docs/UpdatePercentageOptionModel.md) - [UpdatePermissionGroupRequest](docs/UpdatePermissionGroupRequest.md) - [UpdatePreferencesRequest](docs/UpdatePreferencesRequest.md) + - [UpdatePrerequisiteFlagConditionModel](docs/UpdatePrerequisiteFlagConditionModel.md) - [UpdateProductRequest](docs/UpdateProductRequest.md) - [UpdateReasonRequiredEnvironmentModel](docs/UpdateReasonRequiredEnvironmentModel.md) + - [UpdateRolloutPercentageItemModel](docs/UpdateRolloutPercentageItemModel.md) + - [UpdateRolloutRuleModel](docs/UpdateRolloutRuleModel.md) + - [UpdateSegmentConditionModel](docs/UpdateSegmentConditionModel.md) - [UpdateSegmentModel](docs/UpdateSegmentModel.md) - [UpdateSettingValueModel](docs/UpdateSettingValueModel.md) - [UpdateSettingValueWithSettingIdModel](docs/UpdateSettingValueWithSettingIdModel.md) - [UpdateSettingValuesWithIdModel](docs/UpdateSettingValuesWithIdModel.md) - [UpdateTagModel](docs/UpdateTagModel.md) + - [UpdateTargetingRuleModel](docs/UpdateTargetingRuleModel.md) + - [UpdateUserConditionModel](docs/UpdateUserConditionModel.md) + - [UpdateValueModel](docs/UpdateValueModel.md) - [UserComparator](docs/UserComparator.md) - [UserConditionModel](docs/UserConditionModel.md) - [UserModel](docs/UserModel.md) - [ValueModel](docs/ValueModel.md) - [WebHookHttpMethod](docs/WebHookHttpMethod.md) - - [WebHookRequest](docs/WebHookRequest.md) + - [WebHookRequestModel](docs/WebHookRequestModel.md) - [WebhookConfig](docs/WebhookConfig.md) - [WebhookEnvironment](docs/WebhookEnvironment.md) - [WebhookHeaderModel](docs/WebhookHeaderModel.md) - - [WebhookModel](docs/WebhookModel.md) + - [WebhookHeaderResponseModel](docs/WebhookHeaderResponseModel.md) + - [WebhookResponseModel](docs/WebhookResponseModel.md) - [WebhookSigningKeysModel](docs/WebhookSigningKeysModel.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index 55c4491..10044c9 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.4 info: contact: email: support@configcat.com @@ -28,7 +28,7 @@ info: \ the current rate limit period resets.\t\t\t\t\t\t |\n\nWhen the rate limit\ \ is exceeded by a request, the API returns with a `HTTP 429 - Too many requests`\ \ status along with a `Retry-After` HTTP header.\n" - termsOfService: https://configcat.com/termsofserviceagreement + termsOfService: https://configcat.com/policies title: ConfigCat Public Management API version: v1 x-logo: @@ -157,6 +157,8 @@ tags: name: Integration links - description: Access audit log entries. name: Audit logs +- description: List Zombie (stale) flags + name: Zombie (stale) flags - description: Information about the current user. name: Me - description: |- @@ -310,7 +312,7 @@ paths: application/json: schema: items: - $ref: '#/components/schemas/WebhookModel' + $ref: '#/components/schemas/WebhookResponseModel' type: array description: "" "429": @@ -842,7 +844,10 @@ paths: /v1/products/{productId}/auditlogs: get: description: "This endpoint returns the list of Audit log items for a given\ - \ Product \nand the result can be optionally filtered by Config and/or Environment." + \ Product \nand the result can be optionally filtered by Config and/or Environment.\n\ + \nIf neither `fromUtcDateTime` nor `toUtcDateTime` is set, the audit logs\ + \ for the **last 7 days** will be returned.\n\nThe distance between `fromUtcDateTime`\ + \ and `toUtcDateTime` cannot exceed **30 days**." operationId: get-auditlogs parameters: - description: The identifier of the Product. @@ -921,6 +926,91 @@ paths: - Audit logs x-accepts: - application/json + /v1/products/{productId}/staleflags: + get: + description: "This endpoint returns the list of Zombie (stale) flags for a given\ + \ Product \nand the result can be optionally filtered by various parameters." + operationId: get-staleflags + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + - description: The scope of the report. + explode: true + in: query + name: scope + required: false + schema: + $ref: '#/components/schemas/StaleFlagReminderScope' + style: form + - description: The inactivity in days after a feature flag should be considered + stale. + explode: true + in: query + name: staleFlagAgeDays + required: false + schema: + format: int32 + maximum: 90 + minimum: 7 + type: integer + style: form + - description: Consider a feature flag as stale if the feature flag is stale + in all/any of the environments. + explode: true + in: query + name: staleFlagStaleInEnvironmentsType + required: false + schema: + $ref: '#/components/schemas/StaleFlagStaleInEnvironmentsType' + style: form + - description: Ignore environment identifiers from the report. + explode: true + in: query + name: ignoredEnvironmentIds + required: false + schema: + items: + format: uuid + type: string + type: array + style: form + - description: Ignore feature flags from the report based on their tag identifiers. + explode: true + in: query + name: ignoredTagIds + required: false + schema: + items: + format: int64 + type: integer + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StaleFlagProductModel' + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Zombie (stale) flags for Product + tags: + - Zombie (stale) flags + x-accepts: + - application/json /v1/settings/{settingId}/code-references: get: description: "" @@ -1084,7 +1174,7 @@ paths: application/json: schema: items: - $ref: '#/components/schemas/SettingModel' + $ref: '#/components/schemas/DeletedSettingModel' type: array description: "" "400": @@ -1560,7 +1650,10 @@ paths: get: description: "This endpoint returns the list of Audit log items for a given\ \ Organization \nand the result can be optionally filtered by Product and/or\ - \ Config and/or Environment." + \ Config and/or Environment.\n\nIf neither `fromUtcDateTime` nor `toUtcDateTime`\ + \ is set, the audit logs for the **last 7 days** will be returned.\n\nThe\ + \ distance between `fromUtcDateTime` and `toUtcDateTime` cannot exceed **30\ + \ days**." operationId: get-organization-auditlogs parameters: - description: The identifier of the Organization. @@ -4955,7 +5048,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/WebhookModel' + $ref: '#/components/schemas/WebhookResponseModel' description: "When everything is ok, the webhook data is returned." "400": description: Bad request. @@ -5023,7 +5116,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/WebhookModel' + $ref: '#/components/schemas/WebhookResponseModel' description: When the update was successful. "400": description: Bad request. @@ -5059,20 +5152,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/WebHookRequest' + $ref: '#/components/schemas/WebHookRequestModel' text/json: schema: - $ref: '#/components/schemas/WebHookRequest' + $ref: '#/components/schemas/WebHookRequestModel' application/*+json: schema: - $ref: '#/components/schemas/WebHookRequest' + $ref: '#/components/schemas/WebHookRequestModel' required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/WebhookModel' + $ref: '#/components/schemas/WebhookResponseModel' description: When the replace was successful. "400": description: Bad request. @@ -5413,20 +5506,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/WebHookRequest' + $ref: '#/components/schemas/WebHookRequestModel' text/json: schema: - $ref: '#/components/schemas/WebHookRequest' + $ref: '#/components/schemas/WebHookRequestModel' application/*+json: schema: - $ref: '#/components/schemas/WebHookRequest' + $ref: '#/components/schemas/WebHookRequestModel' required: true responses: "201": content: application/json: schema: - $ref: '#/components/schemas/WebhookModel' + $ref: '#/components/schemas/WebhookResponseModel' description: When the creation was successful. "400": description: Bad request. @@ -5806,6 +5899,19 @@ components: details: nullable: true type: string + required: + - actionTarget + - auditLogDateTime + - auditLogId + - auditLogType + - auditLogTypeEnum + - changeSetId + - details + - truncated + - userEmail + - userName + - where + - why type: object AuditLogType: enum: @@ -5898,6 +6004,9 @@ components: - userDisabled - awsConnected - awsDisconnected + - userEnabled + - syncUserDeleted + - syncGroupDeleted type: string CodeReferenceModel: example: @@ -5948,7 +6057,7 @@ components: references: description: The actual references to the given Feature Flag or Setting. items: - $ref: '#/components/schemas/ReferenceLines' + $ref: '#/components/schemas/ReferenceLinesModel' nullable: true type: array commitUrl: @@ -5975,6 +6084,15 @@ components: description: The code reference scanning tool's name. nullable: true type: string + required: + - branch + - codeReferenceId + - commitHash + - commitUrl + - references + - repository + - syncedAt + - uploader type: object CodeReferenceRequest: example: @@ -5983,65 +6101,65 @@ components: - file: file referenceLine: lineText: lineText - lineNumber: 0 + lineNumber: 6 fileUrl: fileUrl postLines: - lineText: lineText - lineNumber: 0 + lineNumber: 6 - lineText: lineText - lineNumber: 0 + lineNumber: 6 preLines: - lineText: lineText - lineNumber: 0 + lineNumber: 6 - lineText: lineText - lineNumber: 0 + lineNumber: 6 - file: file referenceLine: lineText: lineText - lineNumber: 0 + lineNumber: 6 fileUrl: fileUrl postLines: - lineText: lineText - lineNumber: 0 + lineNumber: 6 - lineText: lineText - lineNumber: 0 + lineNumber: 6 preLines: - lineText: lineText - lineNumber: 0 + lineNumber: 6 - lineText: lineText - lineNumber: 0 + lineNumber: 6 settingId: 0 - references: - file: file referenceLine: lineText: lineText - lineNumber: 0 + lineNumber: 6 fileUrl: fileUrl postLines: - lineText: lineText - lineNumber: 0 + lineNumber: 6 - lineText: lineText - lineNumber: 0 + lineNumber: 6 preLines: - lineText: lineText - lineNumber: 0 + lineNumber: 6 - lineText: lineText - lineNumber: 0 + lineNumber: 6 - file: file referenceLine: lineText: lineText - lineNumber: 0 + lineNumber: 6 fileUrl: fileUrl postLines: - lineText: lineText - lineNumber: 0 + lineNumber: 6 - lineText: lineText - lineNumber: 0 + lineNumber: 6 preLines: - lineText: lineText - lineNumber: 0 + lineNumber: 6 - lineText: lineText - lineNumber: 0 + lineNumber: 6 settingId: 0 configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 commitUrl: commitUrl @@ -6093,13 +6211,11 @@ components: deleted. items: type: string - nullable: true type: array flagReferences: description: The actual code reference collection. items: $ref: '#/components/schemas/FlagReference' - nullable: true type: array required: - branch @@ -6107,13 +6223,9 @@ components: - repository type: object ComparisonValueListModel: - example: - hint: hint - value: value properties: value: description: The actual comparison value. - minLength: 1 type: string hint: description: An optional hint for the comparison value. @@ -6126,14 +6238,6 @@ components: type: object ComparisonValueModel: description: The value that the user object's attribute is compared to. - example: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 properties: stringValue: description: The string representation of the comparison value. @@ -6153,35 +6257,26 @@ components: type: object ConditionModel: example: - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 + segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" properties: userCondition: - $ref: '#/components/schemas/UserConditionModel' + allOf: + - $ref: '#/components/schemas/UserConditionModel' + nullable: true segmentCondition: - $ref: '#/components/schemas/SegmentConditionModel' + allOf: + - $ref: '#/components/schemas/SegmentConditionModel' + nullable: true prerequisiteFlagCondition: - $ref: '#/components/schemas/PrerequisiteFlagConditionModel' + allOf: + - $ref: '#/components/schemas/PrerequisiteFlagConditionModel' + nullable: true + required: + - prerequisiteFlagCondition + - segmentCondition + - userCondition type: object ConfigModel: description: Details of the Config. @@ -6210,7 +6305,6 @@ components: type: string name: description: Name of the Config. - nullable: true type: string description: description: Description of the Config. @@ -6226,137 +6320,61 @@ components: type: string evaluationVersion: $ref: '#/components/schemas/EvaluationVersion' + required: + - configId + - description + - evaluationVersion + - migratedConfigId + - name + - order + - product type: object ConfigSettingFormulaModel: example: lastVersionId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 targetingRules: - percentageOptions: - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" - percentageOptions: - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" percentageEvaluationAttribute: percentageEvaluationAttribute defaultValue: stringValue: stringValue @@ -6378,13 +6396,13 @@ components: url: url settingTags: - color: color - tagId: 1 + tagId: 6 name: name - settingTagId: 6 + settingTagId: 0 - color: color - tagId: 1 + tagId: 6 name: name - settingTagId: 6 + settingTagId: 0 setting: createdAt: 2000-01-23T04:56:07.000+00:00 creatorEmail: creatorEmail @@ -6408,7 +6426,6 @@ components: description: The targeting rules of the Feature Flag or Setting. items: $ref: '#/components/schemas/TargetingRuleModel' - nullable: true type: array setting: $ref: '#/components/schemas/SettingDataModel' @@ -6435,13 +6452,11 @@ components: description: The integration links attached to the Feature Flag or Setting. items: $ref: '#/components/schemas/IntegrationLinkModel' - nullable: true type: array settingTags: description: The tags attached to the Feature Flag or Setting. items: $ref: '#/components/schemas/SettingTagModel' - nullable: true type: array settingIdsWherePrerequisite: description: List of Feature Flag and Setting IDs where the actual Feature @@ -6449,8 +6464,19 @@ components: items: format: int32 type: integer - nullable: true type: array + required: + - defaultValue + - integrationLinks + - lastUpdaterUserEmail + - lastUpdaterUserFullName + - lastVersionId + - percentageEvaluationAttribute + - setting + - settingIdsWherePrerequisite + - settingTags + - targetingRules + - updatedAt type: object ConfigSettingFormulasModel: example: @@ -6482,131 +6508,47 @@ components: - lastVersionId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 targetingRules: - percentageOptions: - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" - percentageOptions: - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" percentageEvaluationAttribute: percentageEvaluationAttribute defaultValue: stringValue: stringValue @@ -6628,13 +6570,13 @@ components: url: url settingTags: - color: color - tagId: 1 + tagId: 6 name: name - settingTagId: 6 + settingTagId: 0 - color: color - tagId: 1 + tagId: 6 name: name - settingTagId: 6 + settingTagId: 0 setting: createdAt: 2000-01-23T04:56:07.000+00:00 creatorEmail: creatorEmail @@ -6651,131 +6593,47 @@ components: - lastVersionId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 targetingRules: - percentageOptions: - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" - percentageOptions: - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" percentageEvaluationAttribute: percentageEvaluationAttribute defaultValue: stringValue: stringValue @@ -6797,13 +6655,13 @@ components: url: url settingTags: - color: color - tagId: 1 + tagId: 6 name: name - settingTagId: 6 + settingTagId: 0 - color: color - tagId: 1 + tagId: 6 name: name - settingTagId: 6 + settingTagId: 0 setting: createdAt: 2000-01-23T04:56:07.000+00:00 creatorEmail: creatorEmail @@ -6845,33 +6703,37 @@ components: description: Evaluation descriptors of each updated Feature Flag and Setting. items: $ref: '#/components/schemas/ConfigSettingFormulaModel' - nullable: true type: array featureFlagLimitations: $ref: '#/components/schemas/FeatureFlagLimitations' + required: + - config + - environment + - featureFlagLimitations + - readOnly + - settingFormulas type: object ConfigSettingValueModel: example: rolloutRules: - - comparator: isOneOf + - comparator: "" comparisonValue: comparisonValue segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn + segmentComparator: "" value: "" comparisonAttribute: comparisonAttribute - - comparator: isOneOf + - comparator: "" comparisonValue: comparisonValue segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn + segmentComparator: "" value: "" comparisonAttribute: comparisonAttribute rolloutPercentageItems: - - percentage: 0 + - percentage: 1 value: "" - - percentage: 0 + - percentage: 1 value: "" lastUpdaterUserEmail: lastUpdaterUserEmail - value: "" integrationLinks: - integrationLinkType: trello description: description @@ -6881,15 +6743,16 @@ components: description: description key: key url: url + value: "" settingTags: - color: color - tagId: 1 + tagId: 6 name: name - settingTagId: 6 + settingTagId: 0 - color: color - tagId: 1 + tagId: 6 name: name - settingTagId: 6 + settingTagId: 0 setting: createdAt: 2000-01-23T04:56:07.000+00:00 creatorEmail: creatorEmail @@ -6904,21 +6767,6 @@ components: updatedAt: 2000-01-23T04:56:07.000+00:00 lastUpdaterUserFullName: lastUpdaterUserFullName properties: - rolloutRules: - description: The targeting rule collection. - items: - $ref: '#/components/schemas/RolloutRuleModel' - nullable: true - type: array - rolloutPercentageItems: - description: The percentage rule collection. - items: - $ref: '#/components/schemas/RolloutPercentageItemModel' - nullable: true - type: array - value: - description: The value to serve. It must respect the setting type. - nullable: true setting: $ref: '#/components/schemas/SettingDataModel' updatedAt: @@ -6939,14 +6787,38 @@ components: description: The integration links attached to the Feature Flag or Setting. items: $ref: '#/components/schemas/IntegrationLinkModel' - nullable: true type: array settingTags: description: The tags attached to the Feature Flag or Setting. items: $ref: '#/components/schemas/SettingTagModel' - nullable: true type: array + rolloutRules: + description: The targeting rule collection. + items: + $ref: '#/components/schemas/RolloutRuleModel' + type: array + rolloutPercentageItems: + description: The percentage rule collection. + items: + $ref: '#/components/schemas/RolloutPercentageItemModel' + type: array + value: + allOf: + - $ref: '#/components/schemas/SettingValueType' + description: The value to serve. It must respect the setting type. In some + generated clients for strictly typed languages you may use double/float + properties to handle integer values. + required: + - integrationLinks + - lastUpdaterUserEmail + - lastUpdaterUserFullName + - rolloutPercentageItems + - rolloutRules + - setting + - settingTags + - updatedAt + - value type: object ConfigSettingValuesModel: example: @@ -6977,25 +6849,24 @@ components: readOnly: true settingValues: - rolloutRules: - - comparator: isOneOf + - comparator: "" comparisonValue: comparisonValue segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn + segmentComparator: "" value: "" comparisonAttribute: comparisonAttribute - - comparator: isOneOf + - comparator: "" comparisonValue: comparisonValue segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn + segmentComparator: "" value: "" comparisonAttribute: comparisonAttribute rolloutPercentageItems: - - percentage: 0 + - percentage: 1 value: "" - - percentage: 0 + - percentage: 1 value: "" lastUpdaterUserEmail: lastUpdaterUserEmail - value: "" integrationLinks: - integrationLinkType: trello description: description @@ -7005,15 +6876,16 @@ components: description: description key: key url: url + value: "" settingTags: - color: color - tagId: 1 + tagId: 6 name: name - settingTagId: 6 + settingTagId: 0 - color: color - tagId: 1 + tagId: 6 name: name - settingTagId: 6 + settingTagId: 0 setting: createdAt: 2000-01-23T04:56:07.000+00:00 creatorEmail: creatorEmail @@ -7028,25 +6900,24 @@ components: updatedAt: 2000-01-23T04:56:07.000+00:00 lastUpdaterUserFullName: lastUpdaterUserFullName - rolloutRules: - - comparator: isOneOf + - comparator: "" comparisonValue: comparisonValue segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn + segmentComparator: "" value: "" comparisonAttribute: comparisonAttribute - - comparator: isOneOf + - comparator: "" comparisonValue: comparisonValue segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn + segmentComparator: "" value: "" comparisonAttribute: comparisonAttribute rolloutPercentageItems: - - percentage: 0 + - percentage: 1 value: "" - - percentage: 0 + - percentage: 1 value: "" lastUpdaterUserEmail: lastUpdaterUserEmail - value: "" integrationLinks: - integrationLinkType: trello description: description @@ -7056,15 +6927,16 @@ components: description: description key: key url: url + value: "" settingTags: - color: color - tagId: 1 + tagId: 6 name: name - settingTagId: 6 + settingTagId: 0 - color: color - tagId: 1 + tagId: 6 name: name - settingTagId: 6 + settingTagId: 0 setting: createdAt: 2000-01-23T04:56:07.000+00:00 creatorEmail: creatorEmail @@ -7104,10 +6976,15 @@ components: settingValues: items: $ref: '#/components/schemas/ConfigSettingValueModel' - nullable: true type: array featureFlagLimitations: $ref: '#/components/schemas/FeatureFlagLimitations' + required: + - config + - environment + - featureFlagLimitations + - readOnly + - settingValues type: object ConnectRequest: example: @@ -7145,8 +7022,9 @@ components: nullable: true type: string order: - description: "The order of the Config represented on the ConfigCat Dashboard.\r\ - \nDetermined from an ascending sequence of integers." + description: |- + The order of the Config represented on the ConfigCat Dashboard. + Determined from an ascending sequence of integers. format: int32 nullable: true type: integer @@ -7180,8 +7058,9 @@ components: nullable: true type: string order: - description: "The order of the Environment represented on the ConfigCat\ - \ Dashboard.\r\nDetermined from an ascending sequence of integers." + description: |- + The order of the Environment represented on the ConfigCat Dashboard. + Determined from an ascending sequence of integers. format: int32 nullable: true type: integer @@ -7378,8 +7257,9 @@ components: nullable: true type: string order: - description: "The order of the Product represented on the ConfigCat Dashboard.\r\ - \nDetermined from an ascending sequence of integers." + description: |- + The order of the Product represented on the ConfigCat Dashboard. + Determined from an ascending sequence of integers. format: int32 nullable: true type: integer @@ -7430,6 +7310,7 @@ components: value: "" - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 value: "" + settingIdToInitFrom: 1 hint: hint name: name settingType: boolean @@ -7454,8 +7335,9 @@ components: nullable: true type: array order: - description: "The order of the Setting represented on the ConfigCat Dashboard.\r\ - \nDetermined from an ascending sequence of integers." + description: |- + The order of the Setting represented on the ConfigCat Dashboard. + Determined from an ascending sequence of integers. format: int32 nullable: true type: integer @@ -7473,11 +7355,20 @@ components: $ref: '#/components/schemas/SettingType' initialValues: description: "Optional, initial value of the Feature Flag or Setting in\ - \ the given Environments." + \ the given Environments. Only one of the SettingIdToInitFrom or the InitialValues\ + \ properties can be set." items: $ref: '#/components/schemas/InitialValue' nullable: true type: array + settingIdToInitFrom: + description: "Optional, the SettingId to initialize the values and tags\ + \ of the Feature Flag or Setting from. Only can be set if you have at\ + \ least ReadOnly access in all the Environments. Only one of the SettingIdToInitFrom\ + \ or the InitialValues properties can be set." + format: int32 + nullable: true + type: integer required: - key - name @@ -7509,6 +7400,8 @@ components: properties: hasRemainingIntegrationLink: type: boolean + required: + - hasRemainingIntegrationLink type: object DeleteRepositoryReportsRequest: example: @@ -7543,6 +7436,34 @@ components: - configId - repository type: object + DeletedSettingModel: + example: + hint: hint + name: name + settingType: boolean + key: key + properties: + key: + description: Key of the Feature Flag or Setting. + readOnly: true + type: string + name: + description: Name of the Feature Flag or Setting. + readOnly: true + type: string + hint: + description: Description of the Feature Flag or Setting. + nullable: true + readOnly: true + type: string + settingType: + $ref: '#/components/schemas/SettingType' + required: + - hint + - key + - name + - settingType + type: object EnvironmentAccessModel: example: environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 @@ -7579,6 +7500,14 @@ components: type: boolean environmentAccessType: $ref: '#/components/schemas/EnvironmentAccessType' + required: + - color + - description + - environmentAccessType + - environmentId + - name + - order + - reasonRequired type: object EnvironmentAccessType: description: Represent the environment specific Feature Management permission. @@ -7614,7 +7543,6 @@ components: type: string name: description: Name of the Environment. - nullable: true type: string color: description: The configured color of the Environment. @@ -7632,10 +7560,19 @@ components: description: Determines whether a mandatory reason must be given every time when the Feature Flags or Settings in the given Environment are saved. type: boolean + required: + - color + - description + - environmentId + - name + - order + - product + - reasonRequired type: object EvaluationVersion: - description: "Determines the evaluation version of a Config.\r\nUsing `v2` enables\ - \ the new features of Config V2 (https://configcat.com/docs/advanced/config-v2)." + description: |- + Determines the evaluation version of a Config. + Using `v2` enables the new features of Config V2 (https://configcat.com/docs/advanced/config-v2). enum: - v1 - v2 @@ -7683,6 +7620,14 @@ components: can have within a targeting rule. format: int32 type: integer + required: + - maxComparisonValueLength + - maxComparisonValueListItemLength + - maxComparisonValueListLength + - maxConditionPerTargetingRuleCount + - maxPercentageOptionCount + - maxStringFlagValueLength + - maxTargetingRuleCount type: object FlagReference: example: @@ -7690,33 +7635,33 @@ components: - file: file referenceLine: lineText: lineText - lineNumber: 0 + lineNumber: 6 fileUrl: fileUrl postLines: - lineText: lineText - lineNumber: 0 + lineNumber: 6 - lineText: lineText - lineNumber: 0 + lineNumber: 6 preLines: - lineText: lineText - lineNumber: 0 + lineNumber: 6 - lineText: lineText - lineNumber: 0 + lineNumber: 6 - file: file referenceLine: lineText: lineText - lineNumber: 0 + lineNumber: 6 fileUrl: fileUrl postLines: - lineText: lineText - lineNumber: 0 + lineNumber: 6 - lineText: lineText - lineNumber: 0 + lineNumber: 6 preLines: - lineText: lineText - lineNumber: 0 + lineNumber: 6 - lineText: lineText - lineNumber: 0 + lineNumber: 6 settingId: 0 properties: settingId: @@ -7727,7 +7672,7 @@ components: references: description: The actual references to the given Feature Flag or Setting. items: - $ref: '#/components/schemas/ReferenceLines' + $ref: '#/components/schemas/ReferenceLinesRequest' type: array required: - references @@ -7743,9 +7688,13 @@ components: format: uuid type: string value: + allOf: + - $ref: '#/components/schemas/SettingValueType' description: The initial value in the given Environment. It must respect - the setting type. - nullable: true + the setting type. In some generated clients for strictly typed languages + you may use double/float properties to handle integer values. + required: + - value type: object IntegrationLinkDetail: example: @@ -7815,8 +7764,14 @@ components: readOnly: type: boolean status: - nullable: true type: string + required: + - config + - environment + - product + - readOnly + - setting + - status type: object IntegrationLinkDetailsModel: example: @@ -7940,6 +7895,9 @@ components: allIntegrationLinkCount: format: int32 type: integer + required: + - allIntegrationLinkCount + - details type: object IntegrationLinkModel: example: @@ -7959,6 +7917,11 @@ components: url: nullable: true type: string + required: + - description + - integrationLinkType + - key + - url type: object IntegrationLinkType: enum: @@ -7998,13 +7961,11 @@ components: type: string name: description: Name of the Integration. - nullable: true type: string integrationType: $ref: '#/components/schemas/IntegrationType' parameters: additionalProperties: - nullable: true type: string description: Parameters of the Integration. nullable: true @@ -8015,7 +7976,6 @@ components: items: format: uuid type: string - nullable: true type: array configIds: description: "List of Config IDs that are connected with this Integration.\ @@ -8023,8 +7983,15 @@ components: items: format: uuid type: string - nullable: true type: array + required: + - configIds + - environmentIds + - integrationId + - integrationType + - name + - parameters + - product type: object IntegrationType: enum: @@ -8085,6 +8052,8 @@ components: $ref: '#/components/schemas/IntegrationModel' nullable: true type: array + required: + - integrations type: object InvitationModel: example: @@ -8114,6 +8083,12 @@ components: expired: description: Determines whether the Invitation is expired. type: boolean + required: + - createdAt + - email + - expired + - invitationId + - permissionGroupId type: object InviteMembersRequest: example: @@ -8175,13 +8150,14 @@ components: email: email properties: email: - nullable: true readOnly: true type: string fullName: - nullable: true readOnly: true type: string + required: + - email + - fullName type: object MemberModel: example: @@ -8211,6 +8187,12 @@ components: description: Email of the Member. nullable: true type: string + required: + - email + - fullName + - permissionGroupId + - productId + - userId type: object ModifyIntegrationRequest: example: @@ -8274,19 +8256,21 @@ components: properties: userId: description: Identifier of the Organization Admin. - nullable: true type: string fullName: description: Name of the Organization Admin. - nullable: true type: string email: description: Email of the OrganizationAdmin. - nullable: true type: string twoFactorEnabled: description: Determines whether 2FA is enabled for the Organization Admin. type: boolean + required: + - email + - fullName + - twoFactorEnabled + - userId type: object OrganizationInvitationModel: example: @@ -8331,6 +8315,15 @@ components: description: Expiration time of the Invitation. format: date-time type: string + required: + - createdAt + - email + - expired + - expires + - invitationId + - permissionGroupId + - productId + - productName type: object OrganizationMemberModel: description: Describes an Organization Member. @@ -8355,15 +8348,12 @@ components: properties: userId: description: Identifier of the Organization Admin. - nullable: true type: string fullName: description: Name of the Organization Admin. - nullable: true type: string email: description: Email of the OrganizationAdmin. - nullable: true type: string twoFactorEnabled: description: Determines whether 2FA is enabled for the Organization Admin. @@ -8372,8 +8362,13 @@ components: description: The permissions of the Member. items: $ref: '#/components/schemas/OrganizationPermissionModel' - nullable: true type: array + required: + - email + - fullName + - permissions + - twoFactorEnabled + - userId type: object OrganizationMembersModel: example: @@ -8435,20 +8430,21 @@ components: description: List of Organization Admins. items: $ref: '#/components/schemas/OrganizationAdminModel' - nullable: true type: array billingManagers: description: List of Billing Managers. items: $ref: '#/components/schemas/OrganizationAdminModel' - nullable: true type: array members: description: List of Organization Members. items: $ref: '#/components/schemas/OrganizationMemberModel' - nullable: true type: array + required: + - admins + - billingManagers + - members type: object OrganizationModel: description: Details of the Organization. @@ -8462,8 +8458,10 @@ components: type: string name: description: Name of the Organization. - nullable: true type: string + required: + - name + - organizationId type: object OrganizationPermissionGroupModel: description: Describes the Member's Permission Group within a Product. @@ -8477,8 +8475,10 @@ components: type: integer name: description: Name of the Member's Permission Group. - nullable: true type: string + required: + - name + - permissionGroupId type: object OrganizationPermissionModel: description: Describes the Member's permission. @@ -8494,6 +8494,9 @@ components: $ref: '#/components/schemas/OrganizationProductModel' permissionGroup: $ref: '#/components/schemas/OrganizationPermissionGroupModel' + required: + - permissionGroup + - product type: object OrganizationProductModel: description: Describes the Member's Product. @@ -8507,12 +8510,14 @@ components: type: string name: description: Name of the Member's Product. - nullable: true type: string + required: + - name + - productId type: object PercentageOptionModel: example: - percentage: 5 + percentage: 1 value: stringValue: stringValue intValue: 0 @@ -8588,7 +8593,6 @@ components: type: integer name: description: Name of the Permission Group. - nullable: true type: string canManageMembers: description: Group members can manage team members. @@ -8662,10 +8666,37 @@ components: description: List of environment specific permissions. items: $ref: '#/components/schemas/EnvironmentAccessModel' - nullable: true type: array product: $ref: '#/components/schemas/ProductModel' + required: + - accessType + - canCreateOrUpdateConfig + - canCreateOrUpdateEnvironment + - canCreateOrUpdateSegments + - canCreateOrUpdateSetting + - canCreateOrUpdateTag + - canDeleteConfig + - canDeleteEnvironment + - canDeleteSegments + - canDeleteSetting + - canDeleteTag + - canDisable2FA + - canManageIntegrations + - canManageMembers + - canManageProductPreferences + - canManageWebhook + - canRotateSdkKey + - canTagSetting + - canUseExportImport + - canViewProductAuditLog + - canViewProductStatistics + - canViewSdkKey + - environmentAccesses + - name + - newEnvironmentAccessType + - permissionGroupId + - product type: object PreferencesModel: example: @@ -8700,6 +8731,12 @@ components: mandatorySettingHint: description: Indicates whether Feature flags and Settings must have a hint. type: boolean + required: + - keyGenerationMode + - mandatorySettingHint + - reasonRequired + - reasonRequiredEnvironments + - showVariationId type: object PrerequisiteComparator: description: Prerequisite flag comparison operator used during the evaluation @@ -8710,14 +8747,6 @@ components: type: string PrerequisiteFlagConditionModel: description: Describes a condition that is based on a prerequisite flag. - example: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 properties: prerequisiteSettingId: description: The prerequisite flag's identifier. @@ -8752,21 +8781,28 @@ components: type: string name: description: Name of the Product. - nullable: true type: string description: description: Description of the Product. nullable: true type: string order: - description: "The order of the Product represented on the ConfigCat Dashboard.\r\ - \nDetermined from an ascending sequence of integers." + description: |- + The order of the Product represented on the ConfigCat Dashboard. + Determined from an ascending sequence of integers. format: int32 type: integer reasonRequired: description: Determines whether a mandatory reason must be given every time when the Feature Flags or Settings within a Product are saved. type: boolean + required: + - description + - name + - order + - organization + - productId + - reasonRequired type: object ReasonRequiredEnvironmentModel: example: @@ -8786,8 +8822,12 @@ components: description: Name of the Environment. nullable: true type: string + required: + - environmentId + - environmentName + - reasonRequired type: object - ReferenceLine: + ReferenceLineModel: description: Determines a code reference line. example: lineText: lineText @@ -8805,8 +8845,28 @@ components: type: integer required: - lineNumber + - lineText + type: object + ReferenceLineRequest: + description: Determines a code reference line. + example: + lineText: lineText + lineNumber: 6 + properties: + lineText: + description: The content of the reference line. + maxLength: 1000 + minLength: 0 + nullable: true + type: string + lineNumber: + description: The line number. + format: int32 + type: integer + required: + - lineNumber type: object - ReferenceLines: + ReferenceLinesModel: example: file: file referenceLine: @@ -8840,17 +8900,65 @@ components: preLines: description: The lines before the actual reference line. items: - $ref: '#/components/schemas/ReferenceLine' - nullable: true + $ref: '#/components/schemas/ReferenceLineModel' type: array postLines: description: The lines after the actual reference line. items: - $ref: '#/components/schemas/ReferenceLine' + $ref: '#/components/schemas/ReferenceLineModel' + type: array + referenceLine: + $ref: '#/components/schemas/ReferenceLineModel' + required: + - file + - fileUrl + - postLines + - preLines + - referenceLine + type: object + ReferenceLinesRequest: + example: + file: file + referenceLine: + lineText: lineText + lineNumber: 6 + fileUrl: fileUrl + postLines: + - lineText: lineText + lineNumber: 6 + - lineText: lineText + lineNumber: 6 + preLines: + - lineText: lineText + lineNumber: 6 + - lineText: lineText + lineNumber: 6 + properties: + file: + description: The file's name in where the code reference has been found. + (Appears on the ConfigCat Dashboard) + maxLength: 255 + minLength: 1 + type: string + fileUrl: + description: The file's url. (Used to point to the file on the repository's + website) + maxLength: 1000 + minLength: 0 nullable: true + type: string + preLines: + description: The lines before the actual reference line. + items: + $ref: '#/components/schemas/ReferenceLineRequest' + type: array + postLines: + description: The lines after the actual reference line. + items: + $ref: '#/components/schemas/ReferenceLineRequest' type: array referenceLine: - $ref: '#/components/schemas/ReferenceLine' + $ref: '#/components/schemas/ReferenceLineRequest' required: - file - referenceLine @@ -8879,8 +8987,9 @@ components: nullable: true type: array order: - description: "The order of the Setting represented on the ConfigCat Dashboard.\r\ - \nDetermined from an ascending sequence of integers." + description: |- + The order of the Setting represented on the ConfigCat Dashboard. + Determined from an ascending sequence of integers. format: int32 nullable: true type: integer @@ -8888,13 +8997,12 @@ components: description: The name of the Feature Flag or Setting. maxLength: 255 minLength: 1 + nullable: true type: string - required: - - name type: object RolloutPercentageItemModel: example: - percentage: 0 + percentage: 1 value: "" properties: percentage: @@ -8902,11 +9010,15 @@ components: format: int64 type: integer value: + allOf: + - $ref: '#/components/schemas/SettingValueType' description: The value to serve when the user falls in the percentage rule. - It must respect the setting type. - nullable: true + It must respect the setting type. In some generated clients for strictly + typed languages you may use double/float properties to handle integer + values. required: - percentage + - value type: object RolloutRuleComparator: description: The comparison operator the evaluation process must use when it @@ -8933,10 +9045,10 @@ components: type: string RolloutRuleModel: example: - comparator: isOneOf + comparator: "" comparisonValue: comparisonValue segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn + segmentComparator: "" value: "" comparisonAttribute: comparisonAttribute properties: @@ -8947,22 +9059,35 @@ components: nullable: true type: string comparator: - $ref: '#/components/schemas/RolloutRuleComparator' + allOf: + - $ref: '#/components/schemas/RolloutRuleComparator' + nullable: true comparisonValue: description: The value to compare against. nullable: true type: string value: + allOf: + - $ref: '#/components/schemas/SettingValueType' description: The value to serve when the comparison matches. It must respect - the setting type. - nullable: true + the setting type. In some generated clients for strictly typed languages + you may use double/float properties to handle integer values. segmentComparator: - $ref: '#/components/schemas/SegmentComparator' + allOf: + - $ref: '#/components/schemas/SegmentComparator' + nullable: true segmentId: description: The segment to compare against. format: uuid nullable: true type: string + required: + - comparator + - comparisonAttribute + - comparisonValue + - segmentComparator + - segmentId + - value type: object SdkKeysModel: example: @@ -8971,12 +9096,14 @@ components: properties: primary: description: The primary SDK key. - nullable: true type: string secondary: description: The secondary SDK key. nullable: true type: string + required: + - primary + - secondary type: object SegmentComparator: description: The segment comparison operator used during the evaluation process. @@ -8986,9 +9113,6 @@ components: type: string SegmentConditionModel: description: Describes a condition that is based on a segment. - example: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: segmentId: description: The segment's identifier. @@ -9030,7 +9154,6 @@ components: type: string name: description: Name of the Segment. - nullable: true type: string description: description: Description of the Segment. @@ -9065,6 +9188,18 @@ components: Segment. format: int32 type: integer + required: + - createdAt + - creatorEmail + - creatorFullName + - description + - lastUpdaterEmail + - lastUpdaterFullName + - name + - product + - segmentId + - updatedAt + - usage type: object SegmentModel: example: @@ -9098,7 +9233,6 @@ components: type: string name: description: Name of the Segment. - nullable: true type: string description: description: Description of the Segment. @@ -9131,14 +9265,26 @@ components: comparisonAttribute: description: The user's attribute the evaluation process must take into account. - nullable: true type: string comparator: $ref: '#/components/schemas/RolloutRuleComparator' comparisonValue: description: The value to compare with the given user attribute's value. - nullable: true type: string + required: + - comparator + - comparisonAttribute + - comparisonValue + - createdAt + - creatorEmail + - creatorFullName + - description + - lastUpdaterEmail + - lastUpdaterFullName + - name + - product + - segmentId + - updatedAt type: object SettingDataModel: description: Metadata of a Feature Flag or Setting. @@ -9160,11 +9306,9 @@ components: type: integer key: description: Key of the Feature Flag or Setting. - nullable: true type: string name: description: Name of the Feature Flag or Setting. - nullable: true type: string hint: description: Description of the Feature Flag or Setting. @@ -9192,136 +9336,63 @@ components: type: string isWatching: type: boolean + required: + - createdAt + - creatorEmail + - creatorFullName + - hint + - isWatching + - key + - name + - order + - settingId + - settingType type: object SettingFormulaModel: example: targetingRules: - percentageOptions: - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" - percentageOptions: - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" percentageEvaluationAttribute: percentageEvaluationAttribute defaultValue: stringValue: stringValue @@ -9367,8 +9438,8 @@ components: maxStringFlagValueLength: 3 maxTargetingRuleCount: 5 settingIdsWherePrerequisite: - - 2 - - 2 + - 5 + - 5 integrationLinks: - integrationLinkType: trello description: description @@ -9396,13 +9467,13 @@ components: order: 0 settingTags: - color: color - tagId: 1 + tagId: 6 name: name - settingTagId: 6 + settingTagId: 0 - color: color - tagId: 1 + tagId: 6 name: name - settingTagId: 6 + settingTagId: 0 updatedAt: 2000-01-23T04:56:07.000+00:00 lastUpdaterUserFullName: lastUpdaterUserFullName properties: @@ -9415,7 +9486,6 @@ components: description: The targeting rules of the Feature Flag or Setting. items: $ref: '#/components/schemas/TargetingRuleModel' - nullable: true type: array setting: $ref: '#/components/schemas/SettingDataModel' @@ -9442,13 +9512,11 @@ components: description: The integration links attached to the Feature Flag or Setting. items: $ref: '#/components/schemas/IntegrationLinkModel' - nullable: true type: array settingTags: description: The tags attached to the Feature Flag or Setting. items: $ref: '#/components/schemas/SettingTagModel' - nullable: true type: array settingIdsWherePrerequisite: description: List of Feature Flag and Setting IDs where the actual Feature @@ -9456,7 +9524,6 @@ components: items: format: int32 type: integer - nullable: true type: array config: $ref: '#/components/schemas/ConfigModel' @@ -9466,6 +9533,22 @@ components: type: boolean featureFlagLimitations: $ref: '#/components/schemas/FeatureFlagLimitations' + required: + - config + - defaultValue + - environment + - featureFlagLimitations + - integrationLinks + - lastUpdaterUserEmail + - lastUpdaterUserFullName + - lastVersionId + - percentageEvaluationAttribute + - readOnly + - setting + - settingIdsWherePrerequisite + - settingTags + - targetingRules + - updatedAt type: object SettingModel: description: Metadata of a Feature Flag or Setting. @@ -9511,11 +9594,9 @@ components: type: integer key: description: Key of the Feature Flag or Setting. - nullable: true type: string name: description: Name of the Feature Flag or Setting. - nullable: true type: string hint: description: Description of the Feature Flag or Setting. @@ -9534,7 +9615,6 @@ components: type: string configName: description: Name of the Feature Flag's Config. - nullable: true type: string createdAt: description: The creation time of the Feature Flag or Setting. @@ -9545,15 +9625,25 @@ components: description: The tags attached to the Feature Flag or Setting. items: $ref: '#/components/schemas/TagModel' - nullable: true type: array + required: + - configId + - configName + - createdAt + - hint + - key + - name + - order + - settingId + - settingType + - tags type: object SettingTagModel: example: color: color - tagId: 1 + tagId: 6 name: name - settingTagId: 6 + settingTagId: 0 properties: settingTagId: format: int64 @@ -9562,11 +9652,15 @@ components: format: int64 type: integer name: - nullable: true type: string color: nullable: true type: string + required: + - color + - name + - settingTagId + - tagId type: object SettingType: description: The type of the Feature Flag or Setting. @@ -9579,22 +9673,22 @@ components: SettingValueModel: example: rolloutRules: - - comparator: isOneOf + - comparator: "" comparisonValue: comparisonValue segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn + segmentComparator: "" value: "" comparisonAttribute: comparisonAttribute - - comparator: isOneOf + - comparator: "" comparisonValue: comparisonValue segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn + segmentComparator: "" value: "" comparisonAttribute: comparisonAttribute rolloutPercentageItems: - - percentage: 0 + - percentage: 1 value: "" - - percentage: 0 + - percentage: 1 value: "" lastUpdaterUserEmail: lastUpdaterUserEmail readOnly: true @@ -9633,7 +9727,6 @@ components: maxComparisonValueLength: 2 maxStringFlagValueLength: 3 maxTargetingRuleCount: 5 - value: "" integrationLinks: - integrationLinkType: trello description: description @@ -9643,6 +9736,7 @@ components: description: description key: key url: url + value: "" config: product: productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 @@ -9661,31 +9755,16 @@ components: order: 0 settingTags: - color: color - tagId: 1 + tagId: 6 name: name - settingTagId: 6 + settingTagId: 0 - color: color - tagId: 1 + tagId: 6 name: name - settingTagId: 6 + settingTagId: 0 updatedAt: 2000-01-23T04:56:07.000+00:00 lastUpdaterUserFullName: lastUpdaterUserFullName properties: - rolloutRules: - description: The targeting rule collection. - items: - $ref: '#/components/schemas/RolloutRuleModel' - nullable: true - type: array - rolloutPercentageItems: - description: The percentage rule collection. - items: - $ref: '#/components/schemas/RolloutPercentageItemModel' - nullable: true - type: array - value: - description: The value to serve. It must respect the setting type. - nullable: true setting: $ref: '#/components/schemas/SettingDataModel' updatedAt: @@ -9706,23 +9785,355 @@ components: description: The integration links attached to the Feature Flag or Setting. items: $ref: '#/components/schemas/IntegrationLinkModel' - nullable: true type: array settingTags: description: The tags attached to the Feature Flag or Setting. items: $ref: '#/components/schemas/SettingTagModel' - nullable: true type: array - config: - $ref: '#/components/schemas/ConfigModel' - environment: - $ref: '#/components/schemas/EnvironmentModel' - featureFlagLimitations: - $ref: '#/components/schemas/FeatureFlagLimitations' - readOnly: - type: boolean - type: object + rolloutRules: + description: The targeting rule collection. + items: + $ref: '#/components/schemas/RolloutRuleModel' + type: array + rolloutPercentageItems: + description: The percentage rule collection. + items: + $ref: '#/components/schemas/RolloutPercentageItemModel' + type: array + value: + allOf: + - $ref: '#/components/schemas/SettingValueType' + description: The value to serve. It must respect the setting type. In some + generated clients for strictly typed languages you may use double/float + properties to handle integer values. + config: + $ref: '#/components/schemas/ConfigModel' + environment: + $ref: '#/components/schemas/EnvironmentModel' + featureFlagLimitations: + $ref: '#/components/schemas/FeatureFlagLimitations' + readOnly: + type: boolean + required: + - config + - environment + - featureFlagLimitations + - integrationLinks + - lastUpdaterUserEmail + - lastUpdaterUserFullName + - readOnly + - rolloutPercentageItems + - rolloutRules + - setting + - settingTags + - updatedAt + - value + type: object + SettingValueType: + oneOf: + - type: boolean + - type: string + - format: double + type: number + StaleFlagConfigModel: + example: + settings: + - hint: hint + name: name + settingValues: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + key: key + hasCodeReferences: true + settingId: 0 + tags: + - tagId: 6 + settingTagId: 1 + - tagId: 6 + settingTagId: 1 + - hint: hint + name: name + settingValues: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + key: key + hasCodeReferences: true + settingId: 0 + tags: + - tagId: 6 + settingTagId: 1 + - tagId: 6 + settingTagId: 1 + configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + evaluationVersion: v1 + hasCodeReferences: true + properties: + configId: + description: Identifier of the Config. + format: uuid + type: string + name: + description: Name of the Config. + type: string + evaluationVersion: + $ref: '#/components/schemas/EvaluationVersion' + hasCodeReferences: + description: Config has code references uploaded. + type: boolean + settings: + description: Stale feature flags. + items: + $ref: '#/components/schemas/StaleFlagSettingModel' + type: array + required: + - configId + - evaluationVersion + - hasCodeReferences + - name + - settings + type: object + StaleFlagEnvironmentModel: + example: + environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + properties: + environmentId: + description: Identifier of the Environment. + format: uuid + type: string + name: + description: Name of the Environment. + type: string + required: + - environmentId + - name + type: object + StaleFlagProductModel: + example: + configs: + - settings: + - hint: hint + name: name + settingValues: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + key: key + hasCodeReferences: true + settingId: 0 + tags: + - tagId: 6 + settingTagId: 1 + - tagId: 6 + settingTagId: 1 + - hint: hint + name: name + settingValues: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + key: key + hasCodeReferences: true + settingId: 0 + tags: + - tagId: 6 + settingTagId: 1 + - tagId: 6 + settingTagId: 1 + configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + evaluationVersion: v1 + hasCodeReferences: true + - settings: + - hint: hint + name: name + settingValues: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + key: key + hasCodeReferences: true + settingId: 0 + tags: + - tagId: 6 + settingTagId: 1 + - tagId: 6 + settingTagId: 1 + - hint: hint + name: name + settingValues: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + key: key + hasCodeReferences: true + settingId: 0 + tags: + - tagId: 6 + settingTagId: 1 + - tagId: 6 + settingTagId: 1 + configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + evaluationVersion: v1 + hasCodeReferences: true + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + environments: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + properties: + productId: + description: Identifier of the Product. + format: uuid + type: string + name: + description: Name of the Product. + type: string + configs: + description: Configs that contain stale feature flags. + items: + $ref: '#/components/schemas/StaleFlagConfigModel' + type: array + environments: + description: Environment list. + items: + $ref: '#/components/schemas/StaleFlagEnvironmentModel' + type: array + required: + - configs + - environments + - name + - productId + type: object + StaleFlagReminderScope: + enum: + - all + - watchedByMe + type: string + StaleFlagSettingModel: + example: + hint: hint + name: name + settingValues: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + key: key + hasCodeReferences: true + settingId: 0 + tags: + - tagId: 6 + settingTagId: 1 + - tagId: 6 + settingTagId: 1 + properties: + settingId: + description: Identifier of the Feature Flag or Setting. + format: int32 + type: integer + name: + description: Name of the Feature Flag or Setting. + type: string + key: + description: Key of the Feature Flag or Setting. + type: string + hint: + description: Description of the Feature Flag or Setting. + nullable: true + type: string + hasCodeReferences: + description: Feature Flag or Setting has code references uploaded. + type: boolean + tags: + description: The tags' identifiers attached to the Feature Flag or Setting. + items: + $ref: '#/components/schemas/StaleFlagSettingTagModel' + type: array + settingValues: + description: Environment level feature flag stale data. + items: + $ref: '#/components/schemas/StaleFlagSettingValueModel' + type: array + required: + - hasCodeReferences + - hint + - key + - name + - settingId + - settingValues + - tags + type: object + StaleFlagSettingTagModel: + example: + tagId: 6 + settingTagId: 1 + properties: + tagId: + format: int64 + type: integer + settingTagId: + format: int64 + type: integer + required: + - settingTagId + - tagId + type: object + StaleFlagSettingValueModel: + example: + environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + properties: + environmentId: + description: Identifier of the Environment. + format: uuid + type: string + updatedAt: + description: The last updated date and time when the Feature Flag or Setting. + format: date-time + nullable: true + type: string + isStale: + description: Is the feature flag considered stale in the environment. + type: boolean + required: + - environmentId + - isStale + - updatedAt + type: object + StaleFlagStaleInEnvironmentsType: + enum: + - staleInAnyEnvironments + - staleInAllEnvironments + type: string TagModel: example: product: @@ -9746,96 +10157,117 @@ components: type: integer name: description: Name of the Tag. - nullable: true type: string color: description: The configured color of the Tag. nullable: true type: string + required: + - color + - name + - product + - tagId type: object TargetingRuleModel: example: percentageOptions: - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" properties: conditions: - description: "The list of conditions that are combined with logical AND\ - \ operators.\r\nIt can be one of the following:\r\n- User condition\r\n\ - - Segment condition\r\n- Prerequisite flag condition" + description: |- + The list of conditions that are combined with logical AND operators. + It can be one of the following: + - User condition + - Segment condition + - Prerequisite flag condition items: $ref: '#/components/schemas/ConditionModel' - nullable: true type: array percentageOptions: description: The percentage options from where the evaluation process will choose a value based on the flag's percentage evaluation attribute. items: $ref: '#/components/schemas/PercentageOptionModel' - nullable: true type: array value: - $ref: '#/components/schemas/ValueModel' + allOf: + - $ref: '#/components/schemas/ValueModel' + nullable: true + required: + - conditions + - percentageOptions + - value + type: object + UpdateComparisonValueListModel: + properties: + value: + description: The actual comparison value. + type: string + hint: + description: An optional hint for the comparison value. + maxLength: 1500 + minLength: 0 + nullable: true + type: string + required: + - value + type: object + UpdateComparisonValueModel: + description: The value that the user object's attribute is compared to. + properties: + stringValue: + description: The string representation of the comparison value. + nullable: true + type: string + doubleValue: + description: The number representation of the comparison value. + format: double + nullable: true + type: number + listValue: + description: The list representation of the comparison value. + items: + $ref: '#/components/schemas/UpdateComparisonValueListModel' + nullable: true + type: array + type: object + UpdateConditionModel: + example: + segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + properties: + userCondition: + allOf: + - $ref: '#/components/schemas/UpdateUserConditionModel' + nullable: true + segmentCondition: + allOf: + - $ref: '#/components/schemas/UpdateSegmentConditionModel' + nullable: true + prerequisiteFlagCondition: + allOf: + - $ref: '#/components/schemas/UpdatePrerequisiteFlagConditionModel' + nullable: true type: object UpdateConfigRequest: example: @@ -9856,8 +10288,9 @@ components: nullable: true type: string order: - description: "The order of the Config represented on the ConfigCat Dashboard.\r\ - \nDetermined from an ascending sequence of integers." + description: |- + The order of the Config represented on the ConfigCat Dashboard. + Determined from an ascending sequence of integers. format: int32 nullable: true type: integer @@ -9888,8 +10321,9 @@ components: nullable: true type: string order: - description: "The order of the Environment represented on the ConfigCat\ - \ Dashboard.\r\nDetermined from an ascending sequence of integers." + description: |- + The order of the Environment represented on the ConfigCat Dashboard. + Determined from an ascending sequence of integers. format: int32 nullable: true type: integer @@ -9898,131 +10332,47 @@ components: example: targetingRules: - percentageOptions: - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" - percentageOptions: - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" percentageEvaluationAttribute: percentageEvaluationAttribute defaultValue: stringValue: stringValue @@ -10031,11 +10381,11 @@ components: doubleValue: 6.027456183070403 properties: defaultValue: - $ref: '#/components/schemas/ValueModel' + $ref: '#/components/schemas/UpdateValueModel' targetingRules: description: The targeting rules of the Feature Flag or Setting. items: - $ref: '#/components/schemas/TargetingRuleModel' + $ref: '#/components/schemas/UpdateTargetingRuleModel' nullable: true type: array percentageEvaluationAttribute: @@ -10051,131 +10401,47 @@ components: example: targetingRules: - percentageOptions: - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" - percentageOptions: - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" percentageEvaluationAttribute: percentageEvaluationAttribute defaultValue: stringValue: stringValue @@ -10185,11 +10451,11 @@ components: settingId: 0 properties: defaultValue: - $ref: '#/components/schemas/ValueModel' + $ref: '#/components/schemas/UpdateValueModel' targetingRules: description: The targeting rules of the Feature Flag or Setting. items: - $ref: '#/components/schemas/TargetingRuleModel' + $ref: '#/components/schemas/UpdateTargetingRuleModel' nullable: true type: array percentageEvaluationAttribute: @@ -10210,131 +10476,47 @@ components: updateFormulas: - targetingRules: - percentageOptions: - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" - percentageOptions: - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" percentageEvaluationAttribute: percentageEvaluationAttribute defaultValue: stringValue: stringValue @@ -10344,131 +10526,47 @@ components: settingId: 0 - targetingRules: - percentageOptions: - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" - percentageOptions: - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 - - percentage: 5 + - percentage: 1 value: stringValue: stringValue intValue: 0 boolValue: true doubleValue: 6.027456183070403 conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" percentageEvaluationAttribute: percentageEvaluationAttribute defaultValue: stringValue: stringValue @@ -10481,7 +10579,6 @@ components: description: Evaluation descriptors of each updated Feature Flag and Setting. items: $ref: '#/components/schemas/UpdateEvaluationFormulaWithIdModel' - nullable: true type: array type: object UpdateMemberPermissionsRequest: @@ -10514,6 +10611,26 @@ components: \ Groups that are not listed in the `permissionGroupIds` field." type: boolean type: object + UpdatePercentageOptionModel: + example: + percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + properties: + percentage: + description: A number between 0 and 100 that represents a randomly allocated + fraction of the users. + format: int32 + type: integer + value: + $ref: '#/components/schemas/UpdateValueModel' + required: + - percentage + - value + type: object UpdatePermissionGroupRequest: example: canViewProductStatistics: true @@ -10526,7 +10643,7 @@ components: canManageProductPreferences: true canManageIntegrations: true canDeleteSegments: true - accessType: readOnly + accessType: "" canManageMembers: true canManageWebhook: true canUseExportImport: true @@ -10544,7 +10661,7 @@ components: name: name canViewProductAuditLog: true canCreateOrUpdateTag: true - newEnvironmentAccessType: full + newEnvironmentAccessType: "" properties: name: description: Name of the Permission Group. @@ -10638,9 +10755,13 @@ components: nullable: true type: boolean accessType: - $ref: '#/components/schemas/AccessType' + allOf: + - $ref: '#/components/schemas/AccessType' + nullable: true newEnvironmentAccessType: - $ref: '#/components/schemas/EnvironmentAccessType' + allOf: + - $ref: '#/components/schemas/EnvironmentAccessType' + nullable: true environmentAccesses: description: List of environment specific permissions. items: @@ -10650,7 +10771,7 @@ components: type: object UpdatePreferencesRequest: example: - keyGenerationMode: camelCase + keyGenerationMode: "" showVariationId: true mandatorySettingHint: true reasonRequiredEnvironments: @@ -10666,7 +10787,9 @@ components: nullable: true type: boolean keyGenerationMode: - $ref: '#/components/schemas/KeyGenerationMode' + allOf: + - $ref: '#/components/schemas/KeyGenerationMode' + nullable: true showVariationId: description: Indicates whether a variation ID's must be shown on the ConfigCat Dashboard. @@ -10684,6 +10807,22 @@ components: nullable: true type: array type: object + UpdatePrerequisiteFlagConditionModel: + description: Describes a condition that is based on a prerequisite flag. + properties: + prerequisiteSettingId: + description: The prerequisite flag's identifier. + format: int32 + type: integer + comparator: + $ref: '#/components/schemas/PrerequisiteComparator' + prerequisiteComparisonValue: + $ref: '#/components/schemas/UpdateValueModel' + required: + - comparator + - prerequisiteComparisonValue + - prerequisiteSettingId + type: object UpdateProductRequest: example: name: name @@ -10703,8 +10842,9 @@ components: nullable: true type: string order: - description: "The order of the Product represented on the ConfigCat Dashboard.\r\ - \nDetermined from an ascending sequence of integers." + description: |- + The order of the Product represented on the ConfigCat Dashboard. + Determined from an ascending sequence of integers. format: int32 nullable: true type: integer @@ -10723,9 +10863,83 @@ components: for saving and publishing. type: boolean type: object + UpdateRolloutPercentageItemModel: + example: + percentage: 0 + value: "" + properties: + percentage: + description: The percentage value for the rule. + format: int64 + type: integer + value: + allOf: + - $ref: '#/components/schemas/SettingValueType' + description: The value to serve when the user falls in the percentage rule. + It must respect the setting type. In some generated clients for strictly + typed languages you may use double/float properties to handle integer + values. + required: + - percentage + - value + type: object + UpdateRolloutRuleModel: + example: + comparator: "" + comparisonValue: comparisonValue + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + segmentComparator: "" + value: "" + comparisonAttribute: comparisonAttribute + properties: + comparisonAttribute: + description: The user attribute to compare. + maxLength: 1000 + minLength: 0 + nullable: true + type: string + comparator: + allOf: + - $ref: '#/components/schemas/RolloutRuleComparator' + nullable: true + comparisonValue: + description: The value to compare against. + nullable: true + type: string + value: + allOf: + - $ref: '#/components/schemas/SettingValueType' + description: The value to serve when the comparison matches. It must respect + the setting type. In some generated clients for strictly typed languages + you may use double/float properties to handle integer values. + segmentComparator: + allOf: + - $ref: '#/components/schemas/SegmentComparator' + nullable: true + segmentId: + description: The segment to compare against. + format: uuid + nullable: true + type: string + required: + - value + type: object + UpdateSegmentConditionModel: + description: Describes a condition that is based on a segment. + properties: + segmentId: + description: The segment's identifier. + format: uuid + type: string + comparator: + $ref: '#/components/schemas/SegmentComparator' + required: + - comparator + - segmentId + type: object UpdateSegmentModel: example: - comparator: isOneOf + comparator: "" comparisonValue: comparisonValue name: name description: description @@ -10747,7 +10961,9 @@ components: nullable: true type: string comparator: - $ref: '#/components/schemas/RolloutRuleComparator' + allOf: + - $ref: '#/components/schemas/RolloutRuleComparator' + nullable: true comparisonValue: nullable: true type: string @@ -10755,16 +10971,16 @@ components: UpdateSettingValueModel: example: rolloutRules: - - comparator: isOneOf + - comparator: "" comparisonValue: comparisonValue segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn + segmentComparator: "" value: "" comparisonAttribute: comparisonAttribute - - comparator: isOneOf + - comparator: "" comparisonValue: comparisonValue segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn + segmentComparator: "" value: "" comparisonAttribute: comparisonAttribute rolloutPercentageItems: @@ -10777,32 +10993,35 @@ components: rolloutRules: description: The targeting rule collection. items: - $ref: '#/components/schemas/RolloutRuleModel' - nullable: true + $ref: '#/components/schemas/UpdateRolloutRuleModel' type: array rolloutPercentageItems: description: The percentage rule collection. items: - $ref: '#/components/schemas/RolloutPercentageItemModel' - nullable: true + $ref: '#/components/schemas/UpdateRolloutPercentageItemModel' type: array value: - description: The value to serve. It must respect the setting type. - nullable: true + allOf: + - $ref: '#/components/schemas/SettingValueType' + description: The value to serve. It must respect the setting type. In some + generated clients for strictly typed languages you may use double/float + properties to handle integer values. + required: + - value type: object UpdateSettingValueWithSettingIdModel: example: rolloutRules: - - comparator: isOneOf + - comparator: "" comparisonValue: comparisonValue segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn + segmentComparator: "" value: "" comparisonAttribute: comparisonAttribute - - comparator: isOneOf + - comparator: "" comparisonValue: comparisonValue segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn + segmentComparator: "" value: "" comparisonAttribute: comparisonAttribute rolloutPercentageItems: @@ -10816,37 +11035,40 @@ components: rolloutRules: description: The targeting rule collection. items: - $ref: '#/components/schemas/RolloutRuleModel' - nullable: true + $ref: '#/components/schemas/UpdateRolloutRuleModel' type: array rolloutPercentageItems: description: The percentage rule collection. items: - $ref: '#/components/schemas/RolloutPercentageItemModel' - nullable: true + $ref: '#/components/schemas/UpdateRolloutPercentageItemModel' type: array value: - description: The value to serve. It must respect the setting type. - nullable: true + allOf: + - $ref: '#/components/schemas/SettingValueType' + description: The value to serve. It must respect the setting type. In some + generated clients for strictly typed languages you may use double/float + properties to handle integer values. settingId: description: The id of the Setting. format: int32 type: integer + required: + - value type: object UpdateSettingValuesWithIdModel: example: settingValues: - rolloutRules: - - comparator: isOneOf + - comparator: "" comparisonValue: comparisonValue segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn + segmentComparator: "" value: "" comparisonAttribute: comparisonAttribute - - comparator: isOneOf + - comparator: "" comparisonValue: comparisonValue segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn + segmentComparator: "" value: "" comparisonAttribute: comparisonAttribute rolloutPercentageItems: @@ -10857,16 +11079,16 @@ components: value: "" settingId: 0 - rolloutRules: - - comparator: isOneOf + - comparator: "" comparisonValue: comparisonValue segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn + segmentComparator: "" value: "" comparisonAttribute: comparisonAttribute - - comparator: isOneOf + - comparator: "" comparisonValue: comparisonValue segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn + segmentComparator: "" value: "" comparisonAttribute: comparisonAttribute rolloutPercentageItems: @@ -10881,7 +11103,6 @@ components: description: The values to update. items: $ref: '#/components/schemas/UpdateSettingValueWithSettingIdModel' - nullable: true type: array type: object UpdateTagModel: @@ -10903,6 +11124,98 @@ components: nullable: true type: string type: object + UpdateTargetingRuleModel: + example: + percentageOptions: + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" + properties: + conditions: + description: |- + The list of conditions that are combined with logical AND operators. + It can be one of the following: + - User condition + - Segment condition + - Prerequisite flag condition + items: + $ref: '#/components/schemas/UpdateConditionModel' + nullable: true + type: array + percentageOptions: + description: The percentage options from where the evaluation process will + choose a value based on the flag's percentage evaluation attribute. + items: + $ref: '#/components/schemas/UpdatePercentageOptionModel' + nullable: true + type: array + value: + allOf: + - $ref: '#/components/schemas/UpdateValueModel' + nullable: true + type: object + UpdateUserConditionModel: + description: Describes a condition that is based on user attributes. + properties: + comparisonAttribute: + description: "The User Object attribute that the condition is based on.\ + \ Can be \"User ID\", \"Email\", \"Country\" or any custom attribute." + maxLength: 1000 + minLength: 1 + type: string + comparator: + $ref: '#/components/schemas/UserComparator' + comparisonValue: + $ref: '#/components/schemas/UpdateComparisonValueModel' + required: + - comparator + - comparisonAttribute + - comparisonValue + type: object + UpdateValueModel: + description: Represents the value of a Feature Flag or Setting. + example: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + properties: + boolValue: + description: The served value in case of a boolean Feature Flag. + nullable: true + type: boolean + stringValue: + description: The served value in case of a text Setting. + nullable: true + type: string + intValue: + description: The served value in case of a whole number Setting. + format: int32 + nullable: true + type: integer + doubleValue: + description: The served value in case of a decimal number Setting. + format: double + nullable: true + type: number + type: object UserComparator: description: The comparison operator which defines the relation between the comparison attribute and the comparison value. @@ -10946,17 +11259,6 @@ components: type: string UserConditionModel: description: Describes a condition that is based on user attributes. - example: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute properties: comparisonAttribute: description: "The User Object attribute that the condition is based on.\ @@ -10995,6 +11297,11 @@ components: twoFactorEnabled: description: Determines whether 2FA is enabled for the Member. type: boolean + required: + - email + - fullName + - twoFactorEnabled + - userId type: object ValueModel: description: Represents the value of a Feature Flag or Setting. @@ -11022,13 +11329,18 @@ components: format: double nullable: true type: number + required: + - boolValue + - doubleValue + - intValue + - stringValue type: object WebHookHttpMethod: enum: - get - post type: string - WebHookRequest: + WebHookRequestModel: example: webHookHeaders: - isSecure: true @@ -11037,7 +11349,7 @@ components: - isSecure: true value: value key: key - httpMethod: get + httpMethod: "" url: url content: content properties: @@ -11053,7 +11365,9 @@ components: nullable: true type: string httpMethod: - $ref: '#/components/schemas/WebHookHttpMethod' + allOf: + - $ref: '#/components/schemas/WebHookHttpMethod' + nullable: true webHookHeaders: description: List of HTTP headers. items: @@ -11071,12 +11385,14 @@ components: properties: name: description: The Config's name. - nullable: true type: string configId: description: The Config's identifier. format: uuid type: string + required: + - configId + - name type: object WebhookEnvironment: description: The Environment where the applied changes will invoke the Webhook. @@ -11086,12 +11402,14 @@ components: properties: name: description: The Environment's name. - nullable: true type: string environmentId: description: The Environment's identifier. format: uuid type: string + required: + - environmentId + - name type: object WebhookHeaderModel: example: @@ -11116,7 +11434,27 @@ components: - key - value type: object - WebhookModel: + WebhookHeaderResponseModel: + example: + isSecure: true + value: value + key: key + properties: + key: + description: The HTTP header key. + type: string + value: + description: The HTTP header value. + type: string + isSecure: + description: Indicates whether the header value is sensitive. + type: boolean + required: + - isSecure + - key + - value + type: object + WebhookResponseModel: example: webHookHeaders: - isSecure: true @@ -11142,7 +11480,6 @@ components: type: integer url: description: The URL of the Webhook. - nullable: true type: string httpMethod: $ref: '#/components/schemas/WebHookHttpMethod' @@ -11153,13 +11490,20 @@ components: webHookHeaders: description: List of HTTP headers that the Webhook must send. items: - $ref: '#/components/schemas/WebhookHeaderModel' - nullable: true + $ref: '#/components/schemas/WebhookHeaderResponseModel' type: array config: $ref: '#/components/schemas/WebhookConfig' environment: $ref: '#/components/schemas/WebhookEnvironment' + required: + - config + - content + - environment + - httpMethod + - url + - webHookHeaders + - webhookId type: object WebhookSigningKeysModel: example: @@ -11174,6 +11518,9 @@ components: description: The second signing key. nullable: true type: string + required: + - key1 + - key2 type: object securitySchemes: Basic: @@ -11214,5 +11561,6 @@ x-tagGroups: - name: Diagnostics tags: - Audit logs + - Zombie (stale) flags - Me diff --git a/build.gradle b/build.gradle index 7e2293b..ce7d421 100644 --- a/build.gradle +++ b/build.gradle @@ -22,7 +22,7 @@ plugins { } group = 'com.configcat' -version = '1.1.1' +version = '2.0.0' sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 diff --git a/docs/AuditLogItemModel.md b/docs/AuditLogItemModel.md index 059b8b8..2d84daf 100644 --- a/docs/AuditLogItemModel.md +++ b/docs/AuditLogItemModel.md @@ -7,18 +7,18 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**auditLogId** | **Long** | | [optional] | -|**auditLogDateTime** | **OffsetDateTime** | | [optional] | -|**auditLogTypeEnum** | **AuditLogType** | | [optional] | -|**changeSetId** | **UUID** | | [optional] | -|**truncated** | **Boolean** | | [optional] | -|**auditLogType** | **String** | | [optional] | -|**userEmail** | **String** | | [optional] | -|**userName** | **String** | | [optional] | -|**where** | **String** | | [optional] | -|**why** | **String** | | [optional] | -|**actionTarget** | **String** | | [optional] | -|**details** | **String** | | [optional] | +|**auditLogId** | **Long** | | | +|**auditLogDateTime** | **OffsetDateTime** | | | +|**auditLogTypeEnum** | **AuditLogType** | | | +|**changeSetId** | **UUID** | | | +|**truncated** | **Boolean** | | | +|**auditLogType** | **String** | | | +|**userEmail** | **String** | | | +|**userName** | **String** | | | +|**where** | **String** | | | +|**why** | **String** | | | +|**actionTarget** | **String** | | | +|**details** | **String** | | | diff --git a/docs/AuditLogType.md b/docs/AuditLogType.md index 0c205d6..58996dd 100644 --- a/docs/AuditLogType.md +++ b/docs/AuditLogType.md @@ -183,5 +183,11 @@ * `AWS_DISCONNECTED` (value: `"awsDisconnected"`) +* `USER_ENABLED` (value: `"userEnabled"`) + +* `SYNC_USER_DELETED` (value: `"syncUserDeleted"`) + +* `SYNC_GROUP_DELETED` (value: `"syncGroupDeleted"`) + diff --git a/docs/AuditLogsApi.md b/docs/AuditLogsApi.md index 0b61b06..5446e57 100644 --- a/docs/AuditLogsApi.md +++ b/docs/AuditLogsApi.md @@ -15,7 +15,7 @@ All URIs are relative to *https://api.configcat.com* 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. +This endpoint returns the list of Audit log items for a given Product and the result can be optionally filtered by Config and/or Environment. If neither `fromUtcDateTime` nor `toUtcDateTime` is set, the audit logs for the **last 7 days** will be returned. The distance between `fromUtcDateTime` and `toUtcDateTime` cannot exceed **30 days**. ### Example ```java @@ -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** | [**AuditLogType**](.md)| Filter Audit logs by Audit log type. | [optional] [enum: productCreated, productChanged, productOwnershipTransferred, productDeleted, productsReordered, teamMemberInvited, teamMemberInvitationRevoked, teamMemberJoined, teamMemberPermissionGroupChanged, teamMemberRemoved, teamMemberLeft, teamMemberInvitationChanged, teamMemberInvitationResent, teamMemberInvitationRejected, configCreated, configChanged, configDeleted, configsReordered, environmentCreated, environmentChanged, environmentDeleted, environmentsReordered, settingCreated, settingChanged, settingDeleted, settingsReordered, settingValueChanged, webHookCreated, webHookChanged, webHookDeleted, permissionGroupCreated, permissionGroupChanged, permissionGroupDeleted, permissionGroupDefault, apiKeyAdded, apiKeyRemoved, integrationAdded, integrationChanged, integrationRemoved, apiKeyConnected, integrationLinkAdded, integrationLinkRemoved, organizationAdded, organizationRemoved, organizationChanged, organizationSubscriptionTypeChanged, organizationAdminChanged, organizationAdminLeft, twoFactorDisabledForMember, tagAdded, tagChanged, tagRemoved, settingTagAdded, settingTagRemoved, publicApiAccessTokenAdded, publicApiAccessTokenRemoved, domainAdded, domainVerified, domainRemoved, domainSamlConfigured, domainSamlDeleted, autoProvisioningConfigurationChanged, samlIdpConfigurationAdded, samlIdpConfigurationRemoved, samlIdpConfigurationUpdated, autoProvisioningEnabledChanged, organizationMemberJoined, organizationMemberProductJoinRequested, organizationMemberProductJoinRequestRejected, organizationMemberProductJoinRequestApproved, organizationMemberRemoved, codeReferencesUploaded, codeReferenceDeleted, codeReferenceStaleBranchDeleted, segmentCreated, segmentChanged, segmentDeleted, webhookSigningKeyDeleted, webhookSigningKeyCreated, userProvisioningConfigurationChanged, syncGroupProvisioningRuleChanged, syncGroupsReordered, syncUserProvisioningEnabled, syncUserProvisioningDisabled, userEmailChanged, userFullNameChanged, userDisabled, awsConnected, awsDisconnected] | +| **auditLogType** | [**AuditLogType**](.md)| Filter Audit logs by Audit log type. | [optional] [enum: productCreated, productChanged, productOwnershipTransferred, productDeleted, productsReordered, teamMemberInvited, teamMemberInvitationRevoked, teamMemberJoined, teamMemberPermissionGroupChanged, teamMemberRemoved, teamMemberLeft, teamMemberInvitationChanged, teamMemberInvitationResent, teamMemberInvitationRejected, configCreated, configChanged, configDeleted, configsReordered, environmentCreated, environmentChanged, environmentDeleted, environmentsReordered, settingCreated, settingChanged, settingDeleted, settingsReordered, settingValueChanged, webHookCreated, webHookChanged, webHookDeleted, permissionGroupCreated, permissionGroupChanged, permissionGroupDeleted, permissionGroupDefault, apiKeyAdded, apiKeyRemoved, integrationAdded, integrationChanged, integrationRemoved, apiKeyConnected, integrationLinkAdded, integrationLinkRemoved, organizationAdded, organizationRemoved, organizationChanged, organizationSubscriptionTypeChanged, organizationAdminChanged, organizationAdminLeft, twoFactorDisabledForMember, tagAdded, tagChanged, tagRemoved, settingTagAdded, settingTagRemoved, publicApiAccessTokenAdded, publicApiAccessTokenRemoved, domainAdded, domainVerified, domainRemoved, domainSamlConfigured, domainSamlDeleted, autoProvisioningConfigurationChanged, samlIdpConfigurationAdded, samlIdpConfigurationRemoved, samlIdpConfigurationUpdated, autoProvisioningEnabledChanged, organizationMemberJoined, organizationMemberProductJoinRequested, organizationMemberProductJoinRequestRejected, organizationMemberProductJoinRequestApproved, organizationMemberRemoved, codeReferencesUploaded, codeReferenceDeleted, codeReferenceStaleBranchDeleted, segmentCreated, segmentChanged, segmentDeleted, webhookSigningKeyDeleted, webhookSigningKeyCreated, userProvisioningConfigurationChanged, syncGroupProvisioningRuleChanged, syncGroupsReordered, syncUserProvisioningEnabled, syncUserProvisioningDisabled, userEmailChanged, userFullNameChanged, userDisabled, awsConnected, awsDisconnected, userEnabled, syncUserDeleted, syncGroupDeleted] | | **fromUtcDateTime** | **OffsetDateTime**| Filter Audit logs by starting UTC date. | [optional] | | **toUtcDateTime** | **OffsetDateTime**| Filter Audit logs by ending UTC date. | [optional] | @@ -92,7 +92,7 @@ public class Example { # **getDeletedSettings** -> List<SettingModel> getDeletedSettings(configId) +> List<DeletedSettingModel> getDeletedSettings(configId) List Deleted Settings @@ -121,7 +121,7 @@ public class Example { AuditLogsApi apiInstance = new AuditLogsApi(defaultClient); UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. try { - List result = apiInstance.getDeletedSettings(configId); + List result = apiInstance.getDeletedSettings(configId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuditLogsApi#getDeletedSettings"); @@ -142,7 +142,7 @@ public class Example { ### Return type -[**List<SettingModel>**](SettingModel.md) +[**List<DeletedSettingModel>**](DeletedSettingModel.md) ### Authorization @@ -167,7 +167,7 @@ public class Example { 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. +This endpoint returns the list of Audit log items for a given Organization and the result can be optionally filtered by Product and/or Config and/or Environment. If neither `fromUtcDateTime` nor `toUtcDateTime` is set, the audit logs for the **last 7 days** will be returned. The distance between `fromUtcDateTime` and `toUtcDateTime` cannot exceed **30 days**. ### Example ```java @@ -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** | [**AuditLogType**](.md)| Filter Audit logs by Audit log type. | [optional] [enum: productCreated, productChanged, productOwnershipTransferred, productDeleted, productsReordered, teamMemberInvited, teamMemberInvitationRevoked, teamMemberJoined, teamMemberPermissionGroupChanged, teamMemberRemoved, teamMemberLeft, teamMemberInvitationChanged, teamMemberInvitationResent, teamMemberInvitationRejected, configCreated, configChanged, configDeleted, configsReordered, environmentCreated, environmentChanged, environmentDeleted, environmentsReordered, settingCreated, settingChanged, settingDeleted, settingsReordered, settingValueChanged, webHookCreated, webHookChanged, webHookDeleted, permissionGroupCreated, permissionGroupChanged, permissionGroupDeleted, permissionGroupDefault, apiKeyAdded, apiKeyRemoved, integrationAdded, integrationChanged, integrationRemoved, apiKeyConnected, integrationLinkAdded, integrationLinkRemoved, organizationAdded, organizationRemoved, organizationChanged, organizationSubscriptionTypeChanged, organizationAdminChanged, organizationAdminLeft, twoFactorDisabledForMember, tagAdded, tagChanged, tagRemoved, settingTagAdded, settingTagRemoved, publicApiAccessTokenAdded, publicApiAccessTokenRemoved, domainAdded, domainVerified, domainRemoved, domainSamlConfigured, domainSamlDeleted, autoProvisioningConfigurationChanged, samlIdpConfigurationAdded, samlIdpConfigurationRemoved, samlIdpConfigurationUpdated, autoProvisioningEnabledChanged, organizationMemberJoined, organizationMemberProductJoinRequested, organizationMemberProductJoinRequestRejected, organizationMemberProductJoinRequestApproved, organizationMemberRemoved, codeReferencesUploaded, codeReferenceDeleted, codeReferenceStaleBranchDeleted, segmentCreated, segmentChanged, segmentDeleted, webhookSigningKeyDeleted, webhookSigningKeyCreated, userProvisioningConfigurationChanged, syncGroupProvisioningRuleChanged, syncGroupsReordered, syncUserProvisioningEnabled, syncUserProvisioningDisabled, userEmailChanged, userFullNameChanged, userDisabled, awsConnected, awsDisconnected] | +| **auditLogType** | [**AuditLogType**](.md)| Filter Audit logs by Audit log type. | [optional] [enum: productCreated, productChanged, productOwnershipTransferred, productDeleted, productsReordered, teamMemberInvited, teamMemberInvitationRevoked, teamMemberJoined, teamMemberPermissionGroupChanged, teamMemberRemoved, teamMemberLeft, teamMemberInvitationChanged, teamMemberInvitationResent, teamMemberInvitationRejected, configCreated, configChanged, configDeleted, configsReordered, environmentCreated, environmentChanged, environmentDeleted, environmentsReordered, settingCreated, settingChanged, settingDeleted, settingsReordered, settingValueChanged, webHookCreated, webHookChanged, webHookDeleted, permissionGroupCreated, permissionGroupChanged, permissionGroupDeleted, permissionGroupDefault, apiKeyAdded, apiKeyRemoved, integrationAdded, integrationChanged, integrationRemoved, apiKeyConnected, integrationLinkAdded, integrationLinkRemoved, organizationAdded, organizationRemoved, organizationChanged, organizationSubscriptionTypeChanged, organizationAdminChanged, organizationAdminLeft, twoFactorDisabledForMember, tagAdded, tagChanged, tagRemoved, settingTagAdded, settingTagRemoved, publicApiAccessTokenAdded, publicApiAccessTokenRemoved, domainAdded, domainVerified, domainRemoved, domainSamlConfigured, domainSamlDeleted, autoProvisioningConfigurationChanged, samlIdpConfigurationAdded, samlIdpConfigurationRemoved, samlIdpConfigurationUpdated, autoProvisioningEnabledChanged, organizationMemberJoined, organizationMemberProductJoinRequested, organizationMemberProductJoinRequestRejected, organizationMemberProductJoinRequestApproved, organizationMemberRemoved, codeReferencesUploaded, codeReferenceDeleted, codeReferenceStaleBranchDeleted, segmentCreated, segmentChanged, segmentDeleted, webhookSigningKeyDeleted, webhookSigningKeyCreated, userProvisioningConfigurationChanged, syncGroupProvisioningRuleChanged, syncGroupsReordered, syncUserProvisioningEnabled, syncUserProvisioningDisabled, userEmailChanged, userFullNameChanged, userDisabled, awsConnected, awsDisconnected, userEnabled, syncUserDeleted, syncGroupDeleted] | | **fromUtcDateTime** | **OffsetDateTime**| Filter Audit logs by starting UTC date. | [optional] | | **toUtcDateTime** | **OffsetDateTime**| Filter Audit logs by ending UTC date. | [optional] | diff --git a/docs/CodeReferenceModel.md b/docs/CodeReferenceModel.md index c9726f1..0c38583 100644 --- a/docs/CodeReferenceModel.md +++ b/docs/CodeReferenceModel.md @@ -7,14 +7,14 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**branch** | **String** | The source control branch on where the scan was performed. (Source of the branch selector on the ConfigCat Dashboard) | [optional] | -|**references** | [**List<ReferenceLines>**](ReferenceLines.md) | The actual references to the given Feature Flag or Setting. | [optional] | -|**commitUrl** | **String** | The related commit's URL. | [optional] | -|**commitHash** | **String** | The related commit's hash. | [optional] | -|**syncedAt** | **OffsetDateTime** | The date and time when the reference report was uploaded. | [optional] | -|**repository** | **String** | The source control repository that contains the scanned code. | [optional] | -|**codeReferenceId** | **UUID** | The identifier of the reference report. | [optional] | -|**uploader** | **String** | The code reference scanning tool's name. | [optional] | +|**branch** | **String** | The source control branch on where the scan was performed. (Source of the branch selector on the ConfigCat Dashboard) | | +|**references** | [**List<ReferenceLinesModel>**](ReferenceLinesModel.md) | The actual references to the given Feature Flag or Setting. | | +|**commitUrl** | **String** | The related commit's URL. | | +|**commitHash** | **String** | The related commit's hash. | | +|**syncedAt** | **OffsetDateTime** | The date and time when the reference report was uploaded. | | +|**repository** | **String** | The source control repository that contains the scanned code. | | +|**codeReferenceId** | **UUID** | The identifier of the reference report. | | +|**uploader** | **String** | The code reference scanning tool's name. | | diff --git a/docs/ConditionModel.md b/docs/ConditionModel.md index 9d5f8df..81b5ab0 100644 --- a/docs/ConditionModel.md +++ b/docs/ConditionModel.md @@ -7,9 +7,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**userCondition** | [**UserConditionModel**](UserConditionModel.md) | | [optional] | -|**segmentCondition** | [**SegmentConditionModel**](SegmentConditionModel.md) | | [optional] | -|**prerequisiteFlagCondition** | [**PrerequisiteFlagConditionModel**](PrerequisiteFlagConditionModel.md) | | [optional] | +|**userCondition** | [**UserConditionModel**](UserConditionModel.md) | | | +|**segmentCondition** | [**SegmentConditionModel**](SegmentConditionModel.md) | | | +|**prerequisiteFlagCondition** | [**PrerequisiteFlagConditionModel**](PrerequisiteFlagConditionModel.md) | | | diff --git a/docs/ConfigModel.md b/docs/ConfigModel.md index c50cf67..64b3a71 100644 --- a/docs/ConfigModel.md +++ b/docs/ConfigModel.md @@ -8,13 +8,13 @@ Details of the Config. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**product** | [**ProductModel**](ProductModel.md) | | [optional] | -|**configId** | **UUID** | Identifier of the Config. | [optional] | -|**name** | **String** | Name of the Config. | [optional] | -|**description** | **String** | Description of the Config. | [optional] | -|**order** | **Integer** | The order of the Config represented on the ConfigCat Dashboard. | [optional] | -|**migratedConfigId** | **UUID** | | [optional] | -|**evaluationVersion** | **EvaluationVersion** | | [optional] | +|**product** | [**ProductModel**](ProductModel.md) | | | +|**configId** | **UUID** | Identifier of the Config. | | +|**name** | **String** | Name of the Config. | | +|**description** | **String** | Description of the Config. | | +|**order** | **Integer** | The order of the Config represented on the ConfigCat Dashboard. | | +|**migratedConfigId** | **UUID** | | | +|**evaluationVersion** | **EvaluationVersion** | | | diff --git a/docs/ConfigSettingFormulaModel.md b/docs/ConfigSettingFormulaModel.md index 58f3dac..7a31b7a 100644 --- a/docs/ConfigSettingFormulaModel.md +++ b/docs/ConfigSettingFormulaModel.md @@ -7,17 +7,17 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**lastVersionId** | **UUID** | | [optional] | -|**defaultValue** | [**ValueModel**](ValueModel.md) | | [optional] | -|**targetingRules** | [**List<TargetingRuleModel>**](TargetingRuleModel.md) | The targeting rules of the Feature Flag or Setting. | [optional] | -|**setting** | [**SettingDataModel**](SettingDataModel.md) | | [optional] | -|**updatedAt** | **OffsetDateTime** | The last updated date and time when the Feature Flag or Setting. | [optional] | -|**percentageEvaluationAttribute** | **String** | The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. | [optional] | -|**lastUpdaterUserEmail** | **String** | The email of the user who last updated the Feature Flag or Setting. | [optional] | -|**lastUpdaterUserFullName** | **String** | The name of the user who last updated the Feature Flag or Setting. | [optional] | -|**integrationLinks** | [**List<IntegrationLinkModel>**](IntegrationLinkModel.md) | The integration links attached to the Feature Flag or Setting. | [optional] | -|**settingTags** | [**List<SettingTagModel>**](SettingTagModel.md) | The tags attached to the Feature Flag or Setting. | [optional] | -|**settingIdsWherePrerequisite** | **List<Integer>** | List of Feature Flag and Setting IDs where the actual Feature Flag or Setting is prerequisite. | [optional] | +|**lastVersionId** | **UUID** | | | +|**defaultValue** | [**ValueModel**](ValueModel.md) | | | +|**targetingRules** | [**List<TargetingRuleModel>**](TargetingRuleModel.md) | The targeting rules of the Feature Flag or Setting. | | +|**setting** | [**SettingDataModel**](SettingDataModel.md) | | | +|**updatedAt** | **OffsetDateTime** | The last updated date and time when the Feature Flag or Setting. | | +|**percentageEvaluationAttribute** | **String** | The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. | | +|**lastUpdaterUserEmail** | **String** | The email of the user who last updated the Feature Flag or Setting. | | +|**lastUpdaterUserFullName** | **String** | The name of the user who last updated the Feature Flag or Setting. | | +|**integrationLinks** | [**List<IntegrationLinkModel>**](IntegrationLinkModel.md) | The integration links attached to the Feature Flag or Setting. | | +|**settingTags** | [**List<SettingTagModel>**](SettingTagModel.md) | The tags attached to the Feature Flag or Setting. | | +|**settingIdsWherePrerequisite** | **List<Integer>** | List of Feature Flag and Setting IDs where the actual Feature Flag or Setting is prerequisite. | | diff --git a/docs/ConfigSettingFormulasModel.md b/docs/ConfigSettingFormulasModel.md index 2928d39..48d2ebe 100644 --- a/docs/ConfigSettingFormulasModel.md +++ b/docs/ConfigSettingFormulasModel.md @@ -7,11 +7,11 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**config** | [**ConfigModel**](ConfigModel.md) | | [optional] | -|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | [optional] | -|**readOnly** | **Boolean** | | [optional] | -|**settingFormulas** | [**List<ConfigSettingFormulaModel>**](ConfigSettingFormulaModel.md) | Evaluation descriptors of each updated Feature Flag and Setting. | [optional] | -|**featureFlagLimitations** | [**FeatureFlagLimitations**](FeatureFlagLimitations.md) | | [optional] | +|**config** | [**ConfigModel**](ConfigModel.md) | | | +|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | | +|**readOnly** | **Boolean** | | | +|**settingFormulas** | [**List<ConfigSettingFormulaModel>**](ConfigSettingFormulaModel.md) | Evaluation descriptors of each updated Feature Flag and Setting. | | +|**featureFlagLimitations** | [**FeatureFlagLimitations**](FeatureFlagLimitations.md) | | | diff --git a/docs/ConfigSettingValueModel.md b/docs/ConfigSettingValueModel.md index eb5f4be..f6a4c1b 100644 --- a/docs/ConfigSettingValueModel.md +++ b/docs/ConfigSettingValueModel.md @@ -7,15 +7,15 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**rolloutRules** | [**List<RolloutRuleModel>**](RolloutRuleModel.md) | The targeting rule collection. | [optional] | -|**rolloutPercentageItems** | [**List<RolloutPercentageItemModel>**](RolloutPercentageItemModel.md) | The percentage rule collection. | [optional] | -|**value** | **Object** | The value to serve. It must respect the setting type. | [optional] | -|**setting** | [**SettingDataModel**](SettingDataModel.md) | | [optional] | -|**updatedAt** | **OffsetDateTime** | The last updated date and time when the Feature Flag or Setting. | [optional] | -|**lastUpdaterUserEmail** | **String** | The email of the user who last updated the Feature Flag or Setting. | [optional] | -|**lastUpdaterUserFullName** | **String** | The name of the user who last updated the Feature Flag or Setting. | [optional] | -|**integrationLinks** | [**List<IntegrationLinkModel>**](IntegrationLinkModel.md) | The integration links attached to the Feature Flag or Setting. | [optional] | -|**settingTags** | [**List<SettingTagModel>**](SettingTagModel.md) | The tags attached to the Feature Flag or Setting. | [optional] | +|**setting** | [**SettingDataModel**](SettingDataModel.md) | | | +|**updatedAt** | **OffsetDateTime** | The last updated date and time when the Feature Flag or Setting. | | +|**lastUpdaterUserEmail** | **String** | The email of the user who last updated the Feature Flag or Setting. | | +|**lastUpdaterUserFullName** | **String** | The name of the user who last updated the Feature Flag or Setting. | | +|**integrationLinks** | [**List<IntegrationLinkModel>**](IntegrationLinkModel.md) | The integration links attached to the Feature Flag or Setting. | | +|**settingTags** | [**List<SettingTagModel>**](SettingTagModel.md) | The tags attached to the Feature Flag or Setting. | | +|**rolloutRules** | [**List<RolloutRuleModel>**](RolloutRuleModel.md) | The targeting rule collection. | | +|**rolloutPercentageItems** | [**List<RolloutPercentageItemModel>**](RolloutPercentageItemModel.md) | The percentage rule collection. | | +|**value** | [**SettingValueType**](SettingValueType.md) | The value to serve. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. | | diff --git a/docs/ConfigSettingValuesModel.md b/docs/ConfigSettingValuesModel.md index 7ef6f5d..ce96c52 100644 --- a/docs/ConfigSettingValuesModel.md +++ b/docs/ConfigSettingValuesModel.md @@ -7,11 +7,11 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**config** | [**ConfigModel**](ConfigModel.md) | | [optional] | -|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | [optional] | -|**readOnly** | **Boolean** | | [optional] | -|**settingValues** | [**List<ConfigSettingValueModel>**](ConfigSettingValueModel.md) | | [optional] | -|**featureFlagLimitations** | [**FeatureFlagLimitations**](FeatureFlagLimitations.md) | | [optional] | +|**config** | [**ConfigModel**](ConfigModel.md) | | | +|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | | +|**readOnly** | **Boolean** | | | +|**settingValues** | [**List<ConfigSettingValueModel>**](ConfigSettingValueModel.md) | | | +|**featureFlagLimitations** | [**FeatureFlagLimitations**](FeatureFlagLimitations.md) | | | diff --git a/docs/CreateConfigRequest.md b/docs/CreateConfigRequest.md index 475189d..9ab9aeb 100644 --- a/docs/CreateConfigRequest.md +++ b/docs/CreateConfigRequest.md @@ -9,7 +9,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] | +|**order** | **Integer** | The order of the Config represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | |**evaluationVersion** | **EvaluationVersion** | | [optional] | diff --git a/docs/CreateEnvironmentModel.md b/docs/CreateEnvironmentModel.md index 2cc0476..e15893e 100644 --- a/docs/CreateEnvironmentModel.md +++ b/docs/CreateEnvironmentModel.md @@ -10,7 +10,7 @@ |**name** | **String** | The name of the Environment. | | |**color** | **String** | The color of the Environment. RGB or HTML color codes are allowed. | [optional] | |**description** | **String** | The description of the Environment. | [optional] | -|**order** | **Integer** | The order of the Environment represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | +|**order** | **Integer** | The order of the Environment represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | diff --git a/docs/CreateProductRequest.md b/docs/CreateProductRequest.md index 41c750c..31f81f0 100644 --- a/docs/CreateProductRequest.md +++ b/docs/CreateProductRequest.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**name** | **String** | The name of the Product. | | |**description** | **String** | The description of the Product. | [optional] | -|**order** | **Integer** | The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | +|**order** | **Integer** | The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | diff --git a/docs/CreateSettingInitialValues.md b/docs/CreateSettingInitialValues.md index 7de962e..b0be01b 100644 --- a/docs/CreateSettingInitialValues.md +++ b/docs/CreateSettingInitialValues.md @@ -9,11 +9,12 @@ |------------ | ------------- | ------------- | -------------| |**hint** | **String** | A short description for the setting, shown on the Dashboard UI. | [optional] | |**tags** | **List<Long>** | The IDs of the tags which are attached to the setting. | [optional] | -|**order** | **Integer** | The order of the Setting represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | +|**order** | **Integer** | The order of the Setting represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | |**key** | **String** | The key of the Feature Flag or Setting. | | |**name** | **String** | The name of the Feature Flag or Setting. | | |**settingType** | **SettingType** | | | -|**initialValues** | [**List<InitialValue>**](InitialValue.md) | Optional, initial value of the Feature Flag or Setting in the given Environments. | [optional] | +|**initialValues** | [**List<InitialValue>**](InitialValue.md) | Optional, initial value of the Feature Flag or Setting in the given Environments. Only one of the SettingIdToInitFrom or the InitialValues properties can be set. | [optional] | +|**settingIdToInitFrom** | **Integer** | Optional, the SettingId to initialize the values and tags of the Feature Flag or Setting from. Only can be set if you have at least ReadOnly access in all the Environments. Only one of the SettingIdToInitFrom or the InitialValues properties can be set. | [optional] | diff --git a/docs/DeleteIntegrationLinkModel.md b/docs/DeleteIntegrationLinkModel.md index 2eea6d9..da5447e 100644 --- a/docs/DeleteIntegrationLinkModel.md +++ b/docs/DeleteIntegrationLinkModel.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**hasRemainingIntegrationLink** | **Boolean** | | [optional] | +|**hasRemainingIntegrationLink** | **Boolean** | | | diff --git a/docs/DeletedSettingModel.md b/docs/DeletedSettingModel.md new file mode 100644 index 0000000..ae0c299 --- /dev/null +++ b/docs/DeletedSettingModel.md @@ -0,0 +1,16 @@ + + +# DeletedSettingModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**key** | **String** | Key of the Feature Flag or Setting. | [readonly] | +|**name** | **String** | Name of the Feature Flag or Setting. | [readonly] | +|**hint** | **String** | Description of the Feature Flag or Setting. | [readonly] | +|**settingType** | **SettingType** | | | + + + diff --git a/docs/EnvironmentAccessModel.md b/docs/EnvironmentAccessModel.md index e2f787c..2b3011d 100644 --- a/docs/EnvironmentAccessModel.md +++ b/docs/EnvironmentAccessModel.md @@ -7,13 +7,13 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**environmentId** | **UUID** | Identifier of the Environment. | [optional] | -|**name** | **String** | Name of the Environment. | [optional] | -|**color** | **String** | Color of the Environment. | [optional] | -|**description** | **String** | Description of the Environment. | [optional] | -|**order** | **Integer** | The order of the Environment represented on the ConfigCat Dashboard. | [optional] | -|**reasonRequired** | **Boolean** | Determines whether a mandatory reason must be given every time when the Feature Flags or Settings in the given Environment are saved. | [optional] | -|**environmentAccessType** | **EnvironmentAccessType** | | [optional] | +|**environmentId** | **UUID** | Identifier of the Environment. | | +|**name** | **String** | Name of the Environment. | | +|**color** | **String** | Color of the Environment. | | +|**description** | **String** | Description of the Environment. | | +|**order** | **Integer** | The order of the Environment represented on the ConfigCat Dashboard. | | +|**reasonRequired** | **Boolean** | Determines whether a mandatory reason must be given every time when the Feature Flags or Settings in the given Environment are saved. | | +|**environmentAccessType** | **EnvironmentAccessType** | | | diff --git a/docs/EnvironmentModel.md b/docs/EnvironmentModel.md index adae610..b7323af 100644 --- a/docs/EnvironmentModel.md +++ b/docs/EnvironmentModel.md @@ -8,13 +8,13 @@ Details of the Environment. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**product** | [**ProductModel**](ProductModel.md) | | [optional] | -|**environmentId** | **UUID** | Identifier of the Environment. | [optional] | -|**name** | **String** | Name of the Environment. | [optional] | -|**color** | **String** | The configured color of the Environment. | [optional] | -|**description** | **String** | Description of the Environment. | [optional] | -|**order** | **Integer** | The order of the Environment represented on the ConfigCat Dashboard. | [optional] | -|**reasonRequired** | **Boolean** | Determines whether a mandatory reason must be given every time when the Feature Flags or Settings in the given Environment are saved. | [optional] | +|**product** | [**ProductModel**](ProductModel.md) | | | +|**environmentId** | **UUID** | Identifier of the Environment. | | +|**name** | **String** | Name of the Environment. | | +|**color** | **String** | The configured color of the Environment. | | +|**description** | **String** | Description of the Environment. | | +|**order** | **Integer** | The order of the Environment represented on the ConfigCat Dashboard. | | +|**reasonRequired** | **Boolean** | Determines whether a mandatory reason must be given every time when the Feature Flags or Settings in the given Environment are saved. | | diff --git a/docs/FeatureFlagLimitations.md b/docs/FeatureFlagLimitations.md index 8ce451f..581087a 100644 --- a/docs/FeatureFlagLimitations.md +++ b/docs/FeatureFlagLimitations.md @@ -8,13 +8,13 @@ Subscription limitations regarding Feature flag or Setting values and targeting. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**maxPercentageOptionCount** | **Integer** | Maximum number of percentage options a Feature Flag or Setting can have within a targeting rule. | [optional] | -|**maxTargetingRuleCount** | **Integer** | Maximum number of targeting rules a Feature Flag or Setting can have. | [optional] | -|**maxComparisonValueLength** | **Integer** | Maximum length of a text comparison value. | [optional] | -|**maxComparisonValueListLength** | **Integer** | Maximum item count of a list comparison value. | [optional] | -|**maxComparisonValueListItemLength** | **Integer** | Maximum length of a list comparison value's item. | [optional] | -|**maxStringFlagValueLength** | **Integer** | Maximum length of a text Setting's value. | [optional] | -|**maxConditionPerTargetingRuleCount** | **Integer** | Maximum number of `AND` conditions a Feature Flag or Setting can have within a targeting rule. | [optional] | +|**maxPercentageOptionCount** | **Integer** | Maximum number of percentage options a Feature Flag or Setting can have within a targeting rule. | | +|**maxTargetingRuleCount** | **Integer** | Maximum number of targeting rules a Feature Flag or Setting can have. | | +|**maxComparisonValueLength** | **Integer** | Maximum length of a text comparison value. | | +|**maxComparisonValueListLength** | **Integer** | Maximum item count of a list comparison value. | | +|**maxComparisonValueListItemLength** | **Integer** | Maximum length of a list comparison value's item. | | +|**maxStringFlagValueLength** | **Integer** | Maximum length of a text Setting's value. | | +|**maxConditionPerTargetingRuleCount** | **Integer** | Maximum number of `AND` conditions a Feature Flag or Setting can have within a targeting rule. | | diff --git a/docs/FlagReference.md b/docs/FlagReference.md index 8a2c6be..3301d48 100644 --- a/docs/FlagReference.md +++ b/docs/FlagReference.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**settingId** | **Integer** | The identifier of the Feature Flag or Setting the code reference belongs to. | | -|**references** | [**List<ReferenceLines>**](ReferenceLines.md) | The actual references to the given Feature Flag or Setting. | | +|**references** | [**List<ReferenceLinesRequest>**](ReferenceLinesRequest.md) | The actual references to the given Feature Flag or Setting. | | diff --git a/docs/InitialValue.md b/docs/InitialValue.md index 042536b..40218bd 100644 --- a/docs/InitialValue.md +++ b/docs/InitialValue.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**environmentId** | **UUID** | The ID of the Environment where the initial value must be set. | [optional] | -|**value** | **Object** | The initial value in the given Environment. It must respect the setting type. | [optional] | +|**value** | [**SettingValueType**](SettingValueType.md) | The initial value in the given Environment. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. | | diff --git a/docs/IntegrationLinkDetail.md b/docs/IntegrationLinkDetail.md index 9a3637e..ed85b8d 100644 --- a/docs/IntegrationLinkDetail.md +++ b/docs/IntegrationLinkDetail.md @@ -7,12 +7,12 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**product** | [**ProductModel**](ProductModel.md) | | [optional] | -|**config** | [**ConfigModel**](ConfigModel.md) | | [optional] | -|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | [optional] | -|**setting** | [**SettingDataModel**](SettingDataModel.md) | | [optional] | -|**readOnly** | **Boolean** | | [optional] | -|**status** | **String** | | [optional] | +|**product** | [**ProductModel**](ProductModel.md) | | | +|**config** | [**ConfigModel**](ConfigModel.md) | | | +|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | | +|**setting** | [**SettingDataModel**](SettingDataModel.md) | | | +|**readOnly** | **Boolean** | | | +|**status** | **String** | | | diff --git a/docs/IntegrationLinkDetailsModel.md b/docs/IntegrationLinkDetailsModel.md index 1fa8991..7f6a401 100644 --- a/docs/IntegrationLinkDetailsModel.md +++ b/docs/IntegrationLinkDetailsModel.md @@ -7,8 +7,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**details** | [**List<IntegrationLinkDetail>**](IntegrationLinkDetail.md) | | [optional] [readonly] | -|**allIntegrationLinkCount** | **Integer** | | [optional] | +|**details** | [**List<IntegrationLinkDetail>**](IntegrationLinkDetail.md) | | [readonly] | +|**allIntegrationLinkCount** | **Integer** | | | diff --git a/docs/IntegrationLinkModel.md b/docs/IntegrationLinkModel.md index d81537c..6d69a1c 100644 --- a/docs/IntegrationLinkModel.md +++ b/docs/IntegrationLinkModel.md @@ -7,10 +7,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**key** | **String** | | [optional] | -|**description** | **String** | | [optional] | -|**integrationLinkType** | **IntegrationLinkType** | | [optional] | -|**url** | **String** | | [optional] | +|**key** | **String** | | | +|**description** | **String** | | | +|**integrationLinkType** | **IntegrationLinkType** | | | +|**url** | **String** | | | diff --git a/docs/IntegrationModel.md b/docs/IntegrationModel.md index 46fbccf..ff0b970 100644 --- a/docs/IntegrationModel.md +++ b/docs/IntegrationModel.md @@ -8,13 +8,13 @@ Details of the Integration. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**product** | [**ProductModel**](ProductModel.md) | | [optional] | -|**integrationId** | **UUID** | Identifier of the Integration. | [optional] | -|**name** | **String** | Name of the Integration. | [optional] | -|**integrationType** | **IntegrationType** | | [optional] | -|**parameters** | **Map<String, String>** | Parameters of the Integration. | [optional] | -|**environmentIds** | **List<UUID>** | List of Environment IDs that are connected with this Integration. If the list is empty, all of the Environments are connected. | [optional] | -|**configIds** | **List<UUID>** | List of Config IDs that are connected with this Integration. If the list is empty, all of the Configs are connected. | [optional] | +|**product** | [**ProductModel**](ProductModel.md) | | | +|**integrationId** | **UUID** | Identifier of the Integration. | | +|**name** | **String** | Name of the Integration. | | +|**integrationType** | **IntegrationType** | | | +|**parameters** | **Map<String, String>** | Parameters of the Integration. | | +|**environmentIds** | **List<UUID>** | List of Environment IDs that are connected with this Integration. If the list is empty, all of the Environments are connected. | | +|**configIds** | **List<UUID>** | List of Config IDs that are connected with this Integration. If the list is empty, all of the Configs are connected. | | diff --git a/docs/IntegrationsModel.md b/docs/IntegrationsModel.md index 7073544..eb2e055 100644 --- a/docs/IntegrationsModel.md +++ b/docs/IntegrationsModel.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**integrations** | [**List<IntegrationModel>**](IntegrationModel.md) | The Integrations of the Product. | [optional] | +|**integrations** | [**List<IntegrationModel>**](IntegrationModel.md) | The Integrations of the Product. | | diff --git a/docs/InvitationModel.md b/docs/InvitationModel.md index ec60c30..ecfaa8b 100644 --- a/docs/InvitationModel.md +++ b/docs/InvitationModel.md @@ -7,11 +7,11 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**invitationId** | **UUID** | The identifier of the Invitation. | [optional] | -|**email** | **String** | The invited user's email address. | [optional] | -|**permissionGroupId** | **Long** | The identifier of the Permission Group the user was invited to. | [optional] | -|**createdAt** | **OffsetDateTime** | Creation time of the Invitation. | [optional] | -|**expired** | **Boolean** | Determines whether the Invitation is expired. | [optional] | +|**invitationId** | **UUID** | The identifier of the Invitation. | | +|**email** | **String** | The invited user's email address. | | +|**permissionGroupId** | **Long** | The identifier of the Permission Group the user was invited to. | | +|**createdAt** | **OffsetDateTime** | Creation time of the Invitation. | | +|**expired** | **Boolean** | Determines whether the Invitation is expired. | | diff --git a/docs/MeModel.md b/docs/MeModel.md index 3a50428..67b3010 100644 --- a/docs/MeModel.md +++ b/docs/MeModel.md @@ -7,8 +7,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**email** | **String** | | [optional] [readonly] | -|**fullName** | **String** | | [optional] [readonly] | +|**email** | **String** | | [readonly] | +|**fullName** | **String** | | [readonly] | diff --git a/docs/MemberModel.md b/docs/MemberModel.md index 0989c85..3ce1fac 100644 --- a/docs/MemberModel.md +++ b/docs/MemberModel.md @@ -7,11 +7,11 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**userId** | **String** | Identifier of the Member. | [optional] | -|**productId** | **UUID** | Identifier of the Product where the Member has access. | [optional] | -|**permissionGroupId** | **Long** | Identifier of the Member's Permission Group. | [optional] | -|**fullName** | **String** | Name of the Member. | [optional] | -|**email** | **String** | Email of the Member. | [optional] | +|**userId** | **String** | Identifier of the Member. | | +|**productId** | **UUID** | Identifier of the Product where the Member has access. | | +|**permissionGroupId** | **Long** | Identifier of the Member's Permission Group. | | +|**fullName** | **String** | Name of the Member. | | +|**email** | **String** | Email of the Member. | | diff --git a/docs/OrganizationAdminModel.md b/docs/OrganizationAdminModel.md index c610689..cf5b569 100644 --- a/docs/OrganizationAdminModel.md +++ b/docs/OrganizationAdminModel.md @@ -8,10 +8,10 @@ Describes an Organization Admin. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**userId** | **String** | Identifier of the Organization Admin. | [optional] | -|**fullName** | **String** | Name of the Organization Admin. | [optional] | -|**email** | **String** | Email of the OrganizationAdmin. | [optional] | -|**twoFactorEnabled** | **Boolean** | Determines whether 2FA is enabled for the Organization Admin. | [optional] | +|**userId** | **String** | Identifier of the Organization Admin. | | +|**fullName** | **String** | Name of the Organization Admin. | | +|**email** | **String** | Email of the OrganizationAdmin. | | +|**twoFactorEnabled** | **Boolean** | Determines whether 2FA is enabled for the Organization Admin. | | diff --git a/docs/OrganizationInvitationModel.md b/docs/OrganizationInvitationModel.md index b7c7bf4..af2d4f6 100644 --- a/docs/OrganizationInvitationModel.md +++ b/docs/OrganizationInvitationModel.md @@ -7,14 +7,14 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**invitationId** | **UUID** | The identifier of the Invitation. | [optional] | -|**email** | **String** | The invited user's email address. | [optional] | -|**productId** | **UUID** | The identifier of the Product the user was invited to. | [optional] | -|**productName** | **String** | The name of the Product the user was invited to. | [optional] | -|**permissionGroupId** | **Long** | The identifier of the Permission Group the user was invited to. | [optional] | -|**createdAt** | **OffsetDateTime** | Creation time of the Invitation. | [optional] | -|**expired** | **Boolean** | Determines whether the Invitation is expired. | [optional] | -|**expires** | **OffsetDateTime** | Expiration time of the Invitation. | [optional] | +|**invitationId** | **UUID** | The identifier of the Invitation. | | +|**email** | **String** | The invited user's email address. | | +|**productId** | **UUID** | The identifier of the Product the user was invited to. | | +|**productName** | **String** | The name of the Product the user was invited to. | | +|**permissionGroupId** | **Long** | The identifier of the Permission Group the user was invited to. | | +|**createdAt** | **OffsetDateTime** | Creation time of the Invitation. | | +|**expired** | **Boolean** | Determines whether the Invitation is expired. | | +|**expires** | **OffsetDateTime** | Expiration time of the Invitation. | | diff --git a/docs/OrganizationMemberModel.md b/docs/OrganizationMemberModel.md index 6492d3d..39549eb 100644 --- a/docs/OrganizationMemberModel.md +++ b/docs/OrganizationMemberModel.md @@ -8,11 +8,11 @@ Describes an Organization Member. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**userId** | **String** | Identifier of the Organization Admin. | [optional] | -|**fullName** | **String** | Name of the Organization Admin. | [optional] | -|**email** | **String** | Email of the OrganizationAdmin. | [optional] | -|**twoFactorEnabled** | **Boolean** | Determines whether 2FA is enabled for the Organization Admin. | [optional] | -|**permissions** | [**List<OrganizationPermissionModel>**](OrganizationPermissionModel.md) | The permissions of the Member. | [optional] | +|**userId** | **String** | Identifier of the Organization Admin. | | +|**fullName** | **String** | Name of the Organization Admin. | | +|**email** | **String** | Email of the OrganizationAdmin. | | +|**twoFactorEnabled** | **Boolean** | Determines whether 2FA is enabled for the Organization Admin. | | +|**permissions** | [**List<OrganizationPermissionModel>**](OrganizationPermissionModel.md) | The permissions of the Member. | | diff --git a/docs/OrganizationMembersModel.md b/docs/OrganizationMembersModel.md index 365435a..54da36b 100644 --- a/docs/OrganizationMembersModel.md +++ b/docs/OrganizationMembersModel.md @@ -7,9 +7,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**admins** | [**List<OrganizationAdminModel>**](OrganizationAdminModel.md) | List of Organization Admins. | [optional] | -|**billingManagers** | [**List<OrganizationAdminModel>**](OrganizationAdminModel.md) | List of Billing Managers. | [optional] | -|**members** | [**List<OrganizationMemberModel>**](OrganizationMemberModel.md) | List of Organization Members. | [optional] | +|**admins** | [**List<OrganizationAdminModel>**](OrganizationAdminModel.md) | List of Organization Admins. | | +|**billingManagers** | [**List<OrganizationAdminModel>**](OrganizationAdminModel.md) | List of Billing Managers. | | +|**members** | [**List<OrganizationMemberModel>**](OrganizationMemberModel.md) | List of Organization Members. | | diff --git a/docs/OrganizationModel.md b/docs/OrganizationModel.md index 42e9872..be6ef21 100644 --- a/docs/OrganizationModel.md +++ b/docs/OrganizationModel.md @@ -8,8 +8,8 @@ Details of the Organization. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**organizationId** | **UUID** | Identifier of the Organization. | [optional] | -|**name** | **String** | Name of the Organization. | [optional] | +|**organizationId** | **UUID** | Identifier of the Organization. | | +|**name** | **String** | Name of the Organization. | | diff --git a/docs/OrganizationPermissionGroupModel.md b/docs/OrganizationPermissionGroupModel.md index 9a1bf93..bf8cf08 100644 --- a/docs/OrganizationPermissionGroupModel.md +++ b/docs/OrganizationPermissionGroupModel.md @@ -8,8 +8,8 @@ Describes the Member's Permission Group within a Product. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**permissionGroupId** | **Long** | Identifier of the Member's Permission Group. | [optional] | -|**name** | **String** | Name of the Member's Permission Group. | [optional] | +|**permissionGroupId** | **Long** | Identifier of the Member's Permission Group. | | +|**name** | **String** | Name of the Member's Permission Group. | | diff --git a/docs/OrganizationPermissionModel.md b/docs/OrganizationPermissionModel.md index 3521045..dc16fbc 100644 --- a/docs/OrganizationPermissionModel.md +++ b/docs/OrganizationPermissionModel.md @@ -8,8 +8,8 @@ Describes the Member's permission. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**product** | [**OrganizationProductModel**](OrganizationProductModel.md) | | [optional] | -|**permissionGroup** | [**OrganizationPermissionGroupModel**](OrganizationPermissionGroupModel.md) | | [optional] | +|**product** | [**OrganizationProductModel**](OrganizationProductModel.md) | | | +|**permissionGroup** | [**OrganizationPermissionGroupModel**](OrganizationPermissionGroupModel.md) | | | diff --git a/docs/OrganizationProductModel.md b/docs/OrganizationProductModel.md index c42e97f..a6743d0 100644 --- a/docs/OrganizationProductModel.md +++ b/docs/OrganizationProductModel.md @@ -8,8 +8,8 @@ Describes the Member's Product. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**productId** | **UUID** | Identifier of the Member's Product. | [optional] | -|**name** | **String** | Name of the Member's Product. | [optional] | +|**productId** | **UUID** | Identifier of the Member's Product. | | +|**name** | **String** | Name of the Member's Product. | | diff --git a/docs/PermissionGroupModel.md b/docs/PermissionGroupModel.md index 0cff1be..727e740 100644 --- a/docs/PermissionGroupModel.md +++ b/docs/PermissionGroupModel.md @@ -7,33 +7,33 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**permissionGroupId** | **Long** | Identifier of the Permission Group. | [optional] | -|**name** | **String** | Name of the Permission Group. | [optional] | -|**canManageMembers** | **Boolean** | Group members can manage team members. | [optional] | -|**canCreateOrUpdateConfig** | **Boolean** | Group members can create/update Configs. | [optional] | -|**canDeleteConfig** | **Boolean** | Group members can delete Configs. | [optional] | -|**canCreateOrUpdateEnvironment** | **Boolean** | Group members can create/update Environments. | [optional] | -|**canDeleteEnvironment** | **Boolean** | Group members can delete Environments. | [optional] | -|**canCreateOrUpdateSetting** | **Boolean** | Group members can create/update Feature Flags and Settings. | [optional] | -|**canTagSetting** | **Boolean** | Group members can attach/detach Tags to Feature Flags and Settings. | [optional] | -|**canDeleteSetting** | **Boolean** | Group members can delete Feature Flags and Settings. | [optional] | -|**canCreateOrUpdateTag** | **Boolean** | Group members can create/update Tags. | [optional] | -|**canDeleteTag** | **Boolean** | Group members can delete Tags. | [optional] | -|**canManageWebhook** | **Boolean** | Group members can create/update/delete Webhooks. | [optional] | -|**canUseExportImport** | **Boolean** | Group members can use the export/import feature. | [optional] | -|**canManageProductPreferences** | **Boolean** | Group members can update Product preferences. | [optional] | -|**canManageIntegrations** | **Boolean** | Group members can add and configure integrations. | [optional] | -|**canViewSdkKey** | **Boolean** | Group members has access to SDK keys. | [optional] | -|**canRotateSdkKey** | **Boolean** | Group members can rotate SDK keys. | [optional] | -|**canCreateOrUpdateSegments** | **Boolean** | Group members can create/update Segments. | [optional] | -|**canDeleteSegments** | **Boolean** | Group members can delete Segments. | [optional] | -|**canViewProductAuditLog** | **Boolean** | Group members has access to audit logs. | [optional] | -|**canViewProductStatistics** | **Boolean** | Group members has access to product statistics. | [optional] | -|**canDisable2FA** | **Boolean** | Group members can disable two-factor authentication for other members. | [optional] | -|**accessType** | **AccessType** | | [optional] | -|**newEnvironmentAccessType** | **EnvironmentAccessType** | | [optional] | -|**environmentAccesses** | [**List<EnvironmentAccessModel>**](EnvironmentAccessModel.md) | List of environment specific permissions. | [optional] | -|**product** | [**ProductModel**](ProductModel.md) | | [optional] | +|**permissionGroupId** | **Long** | Identifier of the Permission Group. | | +|**name** | **String** | Name of the Permission Group. | | +|**canManageMembers** | **Boolean** | Group members can manage team members. | | +|**canCreateOrUpdateConfig** | **Boolean** | Group members can create/update Configs. | | +|**canDeleteConfig** | **Boolean** | Group members can delete Configs. | | +|**canCreateOrUpdateEnvironment** | **Boolean** | Group members can create/update Environments. | | +|**canDeleteEnvironment** | **Boolean** | Group members can delete Environments. | | +|**canCreateOrUpdateSetting** | **Boolean** | Group members can create/update Feature Flags and Settings. | | +|**canTagSetting** | **Boolean** | Group members can attach/detach Tags to Feature Flags and Settings. | | +|**canDeleteSetting** | **Boolean** | Group members can delete Feature Flags and Settings. | | +|**canCreateOrUpdateTag** | **Boolean** | Group members can create/update Tags. | | +|**canDeleteTag** | **Boolean** | Group members can delete Tags. | | +|**canManageWebhook** | **Boolean** | Group members can create/update/delete Webhooks. | | +|**canUseExportImport** | **Boolean** | Group members can use the export/import feature. | | +|**canManageProductPreferences** | **Boolean** | Group members can update Product preferences. | | +|**canManageIntegrations** | **Boolean** | Group members can add and configure integrations. | | +|**canViewSdkKey** | **Boolean** | Group members has access to SDK keys. | | +|**canRotateSdkKey** | **Boolean** | Group members can rotate SDK keys. | | +|**canCreateOrUpdateSegments** | **Boolean** | Group members can create/update Segments. | | +|**canDeleteSegments** | **Boolean** | Group members can delete Segments. | | +|**canViewProductAuditLog** | **Boolean** | Group members has access to audit logs. | | +|**canViewProductStatistics** | **Boolean** | Group members has access to product statistics. | | +|**canDisable2FA** | **Boolean** | Group members can disable two-factor authentication for other members. | | +|**accessType** | **AccessType** | | | +|**newEnvironmentAccessType** | **EnvironmentAccessType** | | | +|**environmentAccesses** | [**List<EnvironmentAccessModel>**](EnvironmentAccessModel.md) | List of environment specific permissions. | | +|**product** | [**ProductModel**](ProductModel.md) | | | diff --git a/docs/PreferencesModel.md b/docs/PreferencesModel.md index f80cb08..d0b580b 100644 --- a/docs/PreferencesModel.md +++ b/docs/PreferencesModel.md @@ -7,11 +7,11 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**reasonRequired** | **Boolean** | Indicates that a mandatory note required for saving and publishing. | [optional] | -|**keyGenerationMode** | **KeyGenerationMode** | | [optional] | -|**showVariationId** | **Boolean** | Indicates whether a variation ID's must be shown on the ConfigCat Dashboard. | [optional] | -|**reasonRequiredEnvironments** | [**List<ReasonRequiredEnvironmentModel>**](ReasonRequiredEnvironmentModel.md) | List of Environments where mandatory note must be set before saving and publishing. | [optional] | -|**mandatorySettingHint** | **Boolean** | Indicates whether Feature flags and Settings must have a hint. | [optional] | +|**reasonRequired** | **Boolean** | Indicates that a mandatory note required for saving and publishing. | | +|**keyGenerationMode** | **KeyGenerationMode** | | | +|**showVariationId** | **Boolean** | Indicates whether a variation ID's must be shown on the ConfigCat Dashboard. | | +|**reasonRequiredEnvironments** | [**List<ReasonRequiredEnvironmentModel>**](ReasonRequiredEnvironmentModel.md) | List of Environments where mandatory note must be set before saving and publishing. | | +|**mandatorySettingHint** | **Boolean** | Indicates whether Feature flags and Settings must have a hint. | | diff --git a/docs/ProductModel.md b/docs/ProductModel.md index a870f99..f7f5537 100644 --- a/docs/ProductModel.md +++ b/docs/ProductModel.md @@ -8,12 +8,12 @@ Details of the Product. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**organization** | [**OrganizationModel**](OrganizationModel.md) | | [optional] | -|**productId** | **UUID** | Identifier of the Product. | [optional] | -|**name** | **String** | Name of the Product. | [optional] | -|**description** | **String** | Description of the Product. | [optional] | -|**order** | **Integer** | The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | -|**reasonRequired** | **Boolean** | Determines whether a mandatory reason must be given every time when the Feature Flags or Settings within a Product are saved. | [optional] | +|**organization** | [**OrganizationModel**](OrganizationModel.md) | | | +|**productId** | **UUID** | Identifier of the Product. | | +|**name** | **String** | Name of the Product. | | +|**description** | **String** | Description of the Product. | | +|**order** | **Integer** | The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | | +|**reasonRequired** | **Boolean** | Determines whether a mandatory reason must be given every time when the Feature Flags or Settings within a Product are saved. | | diff --git a/docs/ReasonRequiredEnvironmentModel.md b/docs/ReasonRequiredEnvironmentModel.md index 81a744f..4acabcd 100644 --- a/docs/ReasonRequiredEnvironmentModel.md +++ b/docs/ReasonRequiredEnvironmentModel.md @@ -7,9 +7,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**environmentId** | **UUID** | Identifier of the Environment. | [optional] | -|**reasonRequired** | **Boolean** | Indicates that a mandatory note is required in this Environment for saving and publishing. | [optional] | -|**environmentName** | **String** | Name of the Environment. | [optional] | +|**environmentId** | **UUID** | Identifier of the Environment. | | +|**reasonRequired** | **Boolean** | Indicates that a mandatory note is required in this Environment for saving and publishing. | | +|**environmentName** | **String** | Name of the Environment. | | diff --git a/docs/ReferenceLineModel.md b/docs/ReferenceLineModel.md new file mode 100644 index 0000000..9b2b06b --- /dev/null +++ b/docs/ReferenceLineModel.md @@ -0,0 +1,15 @@ + + +# ReferenceLineModel + +Determines a code reference line. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**lineText** | **String** | The content of the reference line. | | +|**lineNumber** | **Integer** | The line number. | | + + + diff --git a/docs/ReferenceLine.md b/docs/ReferenceLineRequest.md similarity index 92% rename from docs/ReferenceLine.md rename to docs/ReferenceLineRequest.md index e8c1949..7acc786 100644 --- a/docs/ReferenceLine.md +++ b/docs/ReferenceLineRequest.md @@ -1,6 +1,6 @@ -# ReferenceLine +# ReferenceLineRequest Determines a code reference line. diff --git a/docs/ReferenceLines.md b/docs/ReferenceLines.md deleted file mode 100644 index 734452f..0000000 --- a/docs/ReferenceLines.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# ReferenceLines - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**_file** | **String** | The file's name in where the code reference has been found. (Appears on the ConfigCat Dashboard) | | -|**fileUrl** | **String** | The file's url. (Used to point to the file on the repository's website) | [optional] | -|**preLines** | [**List<ReferenceLine>**](ReferenceLine.md) | The lines before the actual reference line. | [optional] | -|**postLines** | [**List<ReferenceLine>**](ReferenceLine.md) | The lines after the actual reference line. | [optional] | -|**referenceLine** | [**ReferenceLine**](ReferenceLine.md) | | | - - - diff --git a/docs/ReferenceLinesModel.md b/docs/ReferenceLinesModel.md new file mode 100644 index 0000000..aecf04e --- /dev/null +++ b/docs/ReferenceLinesModel.md @@ -0,0 +1,17 @@ + + +# ReferenceLinesModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_file** | **String** | The file's name in where the code reference has been found. (Appears on the ConfigCat Dashboard) | | +|**fileUrl** | **String** | The file's url. (Used to point to the file on the repository's website) | | +|**preLines** | [**List<ReferenceLineModel>**](ReferenceLineModel.md) | The lines before the actual reference line. | | +|**postLines** | [**List<ReferenceLineModel>**](ReferenceLineModel.md) | The lines after the actual reference line. | | +|**referenceLine** | [**ReferenceLineModel**](ReferenceLineModel.md) | | | + + + diff --git a/docs/ReferenceLinesRequest.md b/docs/ReferenceLinesRequest.md new file mode 100644 index 0000000..af8a65a --- /dev/null +++ b/docs/ReferenceLinesRequest.md @@ -0,0 +1,17 @@ + + +# ReferenceLinesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_file** | **String** | The file's name in where the code reference has been found. (Appears on the ConfigCat Dashboard) | | +|**fileUrl** | **String** | The file's url. (Used to point to the file on the repository's website) | [optional] | +|**preLines** | [**List<ReferenceLineRequest>**](ReferenceLineRequest.md) | The lines before the actual reference line. | [optional] | +|**postLines** | [**List<ReferenceLineRequest>**](ReferenceLineRequest.md) | The lines after the actual reference line. | [optional] | +|**referenceLine** | [**ReferenceLineRequest**](ReferenceLineRequest.md) | | | + + + diff --git a/docs/ReplaceSettingModel.md b/docs/ReplaceSettingModel.md index b930b01..62425a8 100644 --- a/docs/ReplaceSettingModel.md +++ b/docs/ReplaceSettingModel.md @@ -9,8 +9,8 @@ |------------ | ------------- | ------------- | -------------| |**hint** | **String** | A short description for the setting, shown on the Dashboard UI. | [optional] | |**tags** | **List<Long>** | The IDs of the tags which are attached to the setting. | [optional] | -|**order** | **Integer** | The order of the Setting represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | -|**name** | **String** | The name of the Feature Flag or Setting. | | +|**order** | **Integer** | The order of the Setting represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | +|**name** | **String** | The name of the Feature Flag or Setting. | [optional] | diff --git a/docs/RolloutPercentageItemModel.md b/docs/RolloutPercentageItemModel.md index 52b5c4f..d822f8b 100644 --- a/docs/RolloutPercentageItemModel.md +++ b/docs/RolloutPercentageItemModel.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**percentage** | **Long** | The percentage value for the rule. | | -|**value** | **Object** | The value to serve when the user falls in the percentage rule. It must respect the setting type. | [optional] | +|**value** | [**SettingValueType**](SettingValueType.md) | The value to serve when the user falls in the percentage rule. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. | | diff --git a/docs/RolloutRuleModel.md b/docs/RolloutRuleModel.md index bf136a6..abc3216 100644 --- a/docs/RolloutRuleModel.md +++ b/docs/RolloutRuleModel.md @@ -7,12 +7,12 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**comparisonAttribute** | **String** | The user attribute to compare. | [optional] | -|**comparator** | **RolloutRuleComparator** | | [optional] | -|**comparisonValue** | **String** | The value to compare against. | [optional] | -|**value** | **Object** | The value to serve when the comparison matches. It must respect the setting type. | [optional] | -|**segmentComparator** | **SegmentComparator** | | [optional] | -|**segmentId** | **UUID** | The segment to compare against. | [optional] | +|**comparisonAttribute** | **String** | The user attribute to compare. | | +|**comparator** | **RolloutRuleComparator** | | | +|**comparisonValue** | **String** | The value to compare against. | | +|**value** | [**SettingValueType**](SettingValueType.md) | The value to serve when the comparison matches. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. | | +|**segmentComparator** | **SegmentComparator** | | | +|**segmentId** | **UUID** | The segment to compare against. | | diff --git a/docs/SdkKeysModel.md b/docs/SdkKeysModel.md index a9700a6..8c6e57e 100644 --- a/docs/SdkKeysModel.md +++ b/docs/SdkKeysModel.md @@ -7,8 +7,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**primary** | **String** | The primary SDK key. | [optional] | -|**secondary** | **String** | The secondary SDK key. | [optional] | +|**primary** | **String** | The primary SDK key. | | +|**secondary** | **String** | The secondary SDK key. | | diff --git a/docs/SegmentListModel.md b/docs/SegmentListModel.md index 874bd4f..6a18b0f 100644 --- a/docs/SegmentListModel.md +++ b/docs/SegmentListModel.md @@ -7,17 +7,17 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**product** | [**ProductModel**](ProductModel.md) | | [optional] | -|**segmentId** | **UUID** | Identifier of the Segment. | [optional] | -|**name** | **String** | Name of the Segment. | [optional] | -|**description** | **String** | Description of the Segment. | [optional] | -|**creatorEmail** | **String** | The email of the user who created the Segment. | [optional] | -|**creatorFullName** | **String** | The name of the user who created the Segment. | [optional] | -|**createdAt** | **OffsetDateTime** | The date and time when the Segment was created. | [optional] | -|**lastUpdaterEmail** | **String** | The email of the user who last updated the Segment. | [optional] | -|**lastUpdaterFullName** | **String** | The name of the user who last updated the Segment. | [optional] | -|**updatedAt** | **OffsetDateTime** | The date and time when the Segment was last updated. | [optional] | -|**usage** | **Integer** | Determines how many Feature Flags and Settings are using the Segment. | [optional] | +|**product** | [**ProductModel**](ProductModel.md) | | | +|**segmentId** | **UUID** | Identifier of the Segment. | | +|**name** | **String** | Name of the Segment. | | +|**description** | **String** | Description of the Segment. | | +|**creatorEmail** | **String** | The email of the user who created the Segment. | | +|**creatorFullName** | **String** | The name of the user who created the Segment. | | +|**createdAt** | **OffsetDateTime** | The date and time when the Segment was created. | | +|**lastUpdaterEmail** | **String** | The email of the user who last updated the Segment. | | +|**lastUpdaterFullName** | **String** | The name of the user who last updated the Segment. | | +|**updatedAt** | **OffsetDateTime** | The date and time when the Segment was last updated. | | +|**usage** | **Integer** | Determines how many Feature Flags and Settings are using the Segment. | | diff --git a/docs/SegmentModel.md b/docs/SegmentModel.md index 687b561..0c71af8 100644 --- a/docs/SegmentModel.md +++ b/docs/SegmentModel.md @@ -7,19 +7,19 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**product** | [**ProductModel**](ProductModel.md) | | [optional] | -|**segmentId** | **UUID** | Identifier of the Segment. | [optional] | -|**name** | **String** | Name of the Segment. | [optional] | -|**description** | **String** | Description of the Segment. | [optional] | -|**creatorEmail** | **String** | The email of the user who created the Segment. | [optional] | -|**creatorFullName** | **String** | The name of the user who created the Segment. | [optional] | -|**createdAt** | **OffsetDateTime** | The date and time when the Segment was created. | [optional] | -|**lastUpdaterEmail** | **String** | The email of the user who last updated the Segment. | [optional] | -|**lastUpdaterFullName** | **String** | The name of the user who last updated the Segment. | [optional] | -|**updatedAt** | **OffsetDateTime** | The date and time when the Segment was last updated. | [optional] | -|**comparisonAttribute** | **String** | The user's attribute the evaluation process must take into account. | [optional] | -|**comparator** | **RolloutRuleComparator** | | [optional] | -|**comparisonValue** | **String** | The value to compare with the given user attribute's value. | [optional] | +|**product** | [**ProductModel**](ProductModel.md) | | | +|**segmentId** | **UUID** | Identifier of the Segment. | | +|**name** | **String** | Name of the Segment. | | +|**description** | **String** | Description of the Segment. | | +|**creatorEmail** | **String** | The email of the user who created the Segment. | | +|**creatorFullName** | **String** | The name of the user who created the Segment. | | +|**createdAt** | **OffsetDateTime** | The date and time when the Segment was created. | | +|**lastUpdaterEmail** | **String** | The email of the user who last updated the Segment. | | +|**lastUpdaterFullName** | **String** | The name of the user who last updated the Segment. | | +|**updatedAt** | **OffsetDateTime** | The date and time when the Segment was last updated. | | +|**comparisonAttribute** | **String** | The user's attribute the evaluation process must take into account. | | +|**comparator** | **RolloutRuleComparator** | | | +|**comparisonValue** | **String** | The value to compare with the given user attribute's value. | | diff --git a/docs/SettingDataModel.md b/docs/SettingDataModel.md index 5fd9050..8181e2d 100644 --- a/docs/SettingDataModel.md +++ b/docs/SettingDataModel.md @@ -8,16 +8,16 @@ Metadata of a Feature Flag or Setting. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**settingId** | **Integer** | Identifier of the Feature Flag or Setting. | [optional] | -|**key** | **String** | Key of the Feature Flag or Setting. | [optional] | -|**name** | **String** | Name of the Feature Flag or Setting. | [optional] | -|**hint** | **String** | Description of the Feature Flag or Setting. | [optional] | -|**settingType** | **SettingType** | | [optional] | -|**order** | **Integer** | The order of the Feature Flag or Setting represented on the ConfigCat Dashboard. | [optional] | -|**createdAt** | **OffsetDateTime** | The creation time of the Feature Flag or Setting. | [optional] | -|**creatorEmail** | **String** | The user's email address who created the Feature Flag or Setting. | [optional] | -|**creatorFullName** | **String** | The user's name who created the Feature Flag or Setting. | [optional] | -|**isWatching** | **Boolean** | | [optional] | +|**settingId** | **Integer** | Identifier of the Feature Flag or Setting. | | +|**key** | **String** | Key of the Feature Flag or Setting. | | +|**name** | **String** | Name of the Feature Flag or Setting. | | +|**hint** | **String** | Description of the Feature Flag or Setting. | | +|**settingType** | **SettingType** | | | +|**order** | **Integer** | The order of the Feature Flag or Setting represented on the ConfigCat Dashboard. | | +|**createdAt** | **OffsetDateTime** | The creation time of the Feature Flag or Setting. | | +|**creatorEmail** | **String** | The user's email address who created the Feature Flag or Setting. | | +|**creatorFullName** | **String** | The user's name who created the Feature Flag or Setting. | | +|**isWatching** | **Boolean** | | | diff --git a/docs/SettingFormulaModel.md b/docs/SettingFormulaModel.md index 81c8036..bd26365 100644 --- a/docs/SettingFormulaModel.md +++ b/docs/SettingFormulaModel.md @@ -7,21 +7,21 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**lastVersionId** | **UUID** | | [optional] | -|**defaultValue** | [**ValueModel**](ValueModel.md) | | [optional] | -|**targetingRules** | [**List<TargetingRuleModel>**](TargetingRuleModel.md) | The targeting rules of the Feature Flag or Setting. | [optional] | -|**setting** | [**SettingDataModel**](SettingDataModel.md) | | [optional] | -|**updatedAt** | **OffsetDateTime** | The last updated date and time when the Feature Flag or Setting. | [optional] | -|**percentageEvaluationAttribute** | **String** | The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. | [optional] | -|**lastUpdaterUserEmail** | **String** | The email of the user who last updated the Feature Flag or Setting. | [optional] | -|**lastUpdaterUserFullName** | **String** | The name of the user who last updated the Feature Flag or Setting. | [optional] | -|**integrationLinks** | [**List<IntegrationLinkModel>**](IntegrationLinkModel.md) | The integration links attached to the Feature Flag or Setting. | [optional] | -|**settingTags** | [**List<SettingTagModel>**](SettingTagModel.md) | The tags attached to the Feature Flag or Setting. | [optional] | -|**settingIdsWherePrerequisite** | **List<Integer>** | List of Feature Flag and Setting IDs where the actual Feature Flag or Setting is prerequisite. | [optional] | -|**config** | [**ConfigModel**](ConfigModel.md) | | [optional] | -|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | [optional] | -|**readOnly** | **Boolean** | | [optional] | -|**featureFlagLimitations** | [**FeatureFlagLimitations**](FeatureFlagLimitations.md) | | [optional] | +|**lastVersionId** | **UUID** | | | +|**defaultValue** | [**ValueModel**](ValueModel.md) | | | +|**targetingRules** | [**List<TargetingRuleModel>**](TargetingRuleModel.md) | The targeting rules of the Feature Flag or Setting. | | +|**setting** | [**SettingDataModel**](SettingDataModel.md) | | | +|**updatedAt** | **OffsetDateTime** | The last updated date and time when the Feature Flag or Setting. | | +|**percentageEvaluationAttribute** | **String** | The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. | | +|**lastUpdaterUserEmail** | **String** | The email of the user who last updated the Feature Flag or Setting. | | +|**lastUpdaterUserFullName** | **String** | The name of the user who last updated the Feature Flag or Setting. | | +|**integrationLinks** | [**List<IntegrationLinkModel>**](IntegrationLinkModel.md) | The integration links attached to the Feature Flag or Setting. | | +|**settingTags** | [**List<SettingTagModel>**](SettingTagModel.md) | The tags attached to the Feature Flag or Setting. | | +|**settingIdsWherePrerequisite** | **List<Integer>** | List of Feature Flag and Setting IDs where the actual Feature Flag or Setting is prerequisite. | | +|**config** | [**ConfigModel**](ConfigModel.md) | | | +|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | | +|**readOnly** | **Boolean** | | | +|**featureFlagLimitations** | [**FeatureFlagLimitations**](FeatureFlagLimitations.md) | | | diff --git a/docs/SettingModel.md b/docs/SettingModel.md index 664391a..5548de1 100644 --- a/docs/SettingModel.md +++ b/docs/SettingModel.md @@ -8,16 +8,16 @@ Metadata of a Feature Flag or Setting. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**settingId** | **Integer** | Identifier of the Feature Flag or Setting. | [optional] | -|**key** | **String** | Key of the Feature Flag or Setting. | [optional] | -|**name** | **String** | Name of the Feature Flag or Setting. | [optional] | -|**hint** | **String** | Description of the Feature Flag or Setting. | [optional] | -|**order** | **Integer** | The order of the Feature Flag or Setting represented on the ConfigCat Dashboard. | [optional] | -|**settingType** | **SettingType** | | [optional] | -|**configId** | **UUID** | Identifier of the Feature Flag's Config. | [optional] | -|**configName** | **String** | Name of the Feature Flag's Config. | [optional] | -|**createdAt** | **OffsetDateTime** | The creation time of the Feature Flag or Setting. | [optional] | -|**tags** | [**List<TagModel>**](TagModel.md) | The tags attached to the Feature Flag or Setting. | [optional] | +|**settingId** | **Integer** | Identifier of the Feature Flag or Setting. | | +|**key** | **String** | Key of the Feature Flag or Setting. | | +|**name** | **String** | Name of the Feature Flag or Setting. | | +|**hint** | **String** | Description of the Feature Flag or Setting. | | +|**order** | **Integer** | The order of the Feature Flag or Setting represented on the ConfigCat Dashboard. | | +|**settingType** | **SettingType** | | | +|**configId** | **UUID** | Identifier of the Feature Flag's Config. | | +|**configName** | **String** | Name of the Feature Flag's Config. | | +|**createdAt** | **OffsetDateTime** | The creation time of the Feature Flag or Setting. | | +|**tags** | [**List<TagModel>**](TagModel.md) | The tags attached to the Feature Flag or Setting. | | diff --git a/docs/SettingTagModel.md b/docs/SettingTagModel.md index 95dbd46..8160ba0 100644 --- a/docs/SettingTagModel.md +++ b/docs/SettingTagModel.md @@ -7,10 +7,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**settingTagId** | **Long** | | [optional] | -|**tagId** | **Long** | | [optional] | -|**name** | **String** | | [optional] | -|**color** | **String** | | [optional] | +|**settingTagId** | **Long** | | | +|**tagId** | **Long** | | | +|**name** | **String** | | | +|**color** | **String** | | | diff --git a/docs/SettingValueModel.md b/docs/SettingValueModel.md index 8f3736d..a76855e 100644 --- a/docs/SettingValueModel.md +++ b/docs/SettingValueModel.md @@ -7,19 +7,19 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**rolloutRules** | [**List<RolloutRuleModel>**](RolloutRuleModel.md) | The targeting rule collection. | [optional] | -|**rolloutPercentageItems** | [**List<RolloutPercentageItemModel>**](RolloutPercentageItemModel.md) | The percentage rule collection. | [optional] | -|**value** | **Object** | The value to serve. It must respect the setting type. | [optional] | -|**setting** | [**SettingDataModel**](SettingDataModel.md) | | [optional] | -|**updatedAt** | **OffsetDateTime** | The last updated date and time when the Feature Flag or Setting. | [optional] | -|**lastUpdaterUserEmail** | **String** | The email of the user who last updated the Feature Flag or Setting. | [optional] | -|**lastUpdaterUserFullName** | **String** | The name of the user who last updated the Feature Flag or Setting. | [optional] | -|**integrationLinks** | [**List<IntegrationLinkModel>**](IntegrationLinkModel.md) | The integration links attached to the Feature Flag or Setting. | [optional] | -|**settingTags** | [**List<SettingTagModel>**](SettingTagModel.md) | The tags attached to the Feature Flag or Setting. | [optional] | -|**config** | [**ConfigModel**](ConfigModel.md) | | [optional] | -|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | [optional] | -|**featureFlagLimitations** | [**FeatureFlagLimitations**](FeatureFlagLimitations.md) | | [optional] | -|**readOnly** | **Boolean** | | [optional] | +|**setting** | [**SettingDataModel**](SettingDataModel.md) | | | +|**updatedAt** | **OffsetDateTime** | The last updated date and time when the Feature Flag or Setting. | | +|**lastUpdaterUserEmail** | **String** | The email of the user who last updated the Feature Flag or Setting. | | +|**lastUpdaterUserFullName** | **String** | The name of the user who last updated the Feature Flag or Setting. | | +|**integrationLinks** | [**List<IntegrationLinkModel>**](IntegrationLinkModel.md) | The integration links attached to the Feature Flag or Setting. | | +|**settingTags** | [**List<SettingTagModel>**](SettingTagModel.md) | The tags attached to the Feature Flag or Setting. | | +|**rolloutRules** | [**List<RolloutRuleModel>**](RolloutRuleModel.md) | The targeting rule collection. | | +|**rolloutPercentageItems** | [**List<RolloutPercentageItemModel>**](RolloutPercentageItemModel.md) | The percentage rule collection. | | +|**value** | [**SettingValueType**](SettingValueType.md) | The value to serve. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. | | +|**config** | [**ConfigModel**](ConfigModel.md) | | | +|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | | +|**featureFlagLimitations** | [**FeatureFlagLimitations**](FeatureFlagLimitations.md) | | | +|**readOnly** | **Boolean** | | | diff --git a/docs/SettingValueType.md b/docs/SettingValueType.md new file mode 100644 index 0000000..7f593b8 --- /dev/null +++ b/docs/SettingValueType.md @@ -0,0 +1,12 @@ + + +# SettingValueType + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/docs/StaleFlagConfigModel.md b/docs/StaleFlagConfigModel.md new file mode 100644 index 0000000..6544b79 --- /dev/null +++ b/docs/StaleFlagConfigModel.md @@ -0,0 +1,17 @@ + + +# StaleFlagConfigModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**configId** | **UUID** | Identifier of the Config. | | +|**name** | **String** | Name of the Config. | | +|**evaluationVersion** | **EvaluationVersion** | | | +|**hasCodeReferences** | **Boolean** | Config has code references uploaded. | | +|**settings** | [**List<StaleFlagSettingModel>**](StaleFlagSettingModel.md) | Stale feature flags. | | + + + diff --git a/docs/StaleFlagEnvironmentModel.md b/docs/StaleFlagEnvironmentModel.md new file mode 100644 index 0000000..c7a0e48 --- /dev/null +++ b/docs/StaleFlagEnvironmentModel.md @@ -0,0 +1,14 @@ + + +# StaleFlagEnvironmentModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**environmentId** | **UUID** | Identifier of the Environment. | | +|**name** | **String** | Name of the Environment. | | + + + diff --git a/docs/StaleFlagProductModel.md b/docs/StaleFlagProductModel.md new file mode 100644 index 0000000..6b13bcc --- /dev/null +++ b/docs/StaleFlagProductModel.md @@ -0,0 +1,16 @@ + + +# StaleFlagProductModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**productId** | **UUID** | Identifier of the Product. | | +|**name** | **String** | Name of the Product. | | +|**configs** | [**List<StaleFlagConfigModel>**](StaleFlagConfigModel.md) | Configs that contain stale feature flags. | | +|**environments** | [**List<StaleFlagEnvironmentModel>**](StaleFlagEnvironmentModel.md) | Environment list. | | + + + diff --git a/docs/StaleFlagReminderScope.md b/docs/StaleFlagReminderScope.md new file mode 100644 index 0000000..7d3d6dc --- /dev/null +++ b/docs/StaleFlagReminderScope.md @@ -0,0 +1,13 @@ + + +# StaleFlagReminderScope + +## Enum + + +* `ALL` (value: `"all"`) + +* `WATCHED_BY_ME` (value: `"watchedByMe"`) + + + diff --git a/docs/StaleFlagSettingModel.md b/docs/StaleFlagSettingModel.md new file mode 100644 index 0000000..150323c --- /dev/null +++ b/docs/StaleFlagSettingModel.md @@ -0,0 +1,19 @@ + + +# StaleFlagSettingModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**settingId** | **Integer** | Identifier of the Feature Flag or Setting. | | +|**name** | **String** | Name of the Feature Flag or Setting. | | +|**key** | **String** | Key of the Feature Flag or Setting. | | +|**hint** | **String** | Description of the Feature Flag or Setting. | | +|**hasCodeReferences** | **Boolean** | Feature Flag or Setting has code references uploaded. | | +|**tags** | [**List<StaleFlagSettingTagModel>**](StaleFlagSettingTagModel.md) | The tags' identifiers attached to the Feature Flag or Setting. | | +|**settingValues** | [**List<StaleFlagSettingValueModel>**](StaleFlagSettingValueModel.md) | Environment level feature flag stale data. | | + + + diff --git a/docs/StaleFlagSettingTagModel.md b/docs/StaleFlagSettingTagModel.md new file mode 100644 index 0000000..2333f1b --- /dev/null +++ b/docs/StaleFlagSettingTagModel.md @@ -0,0 +1,14 @@ + + +# StaleFlagSettingTagModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**tagId** | **Long** | | | +|**settingTagId** | **Long** | | | + + + diff --git a/docs/StaleFlagSettingValueModel.md b/docs/StaleFlagSettingValueModel.md new file mode 100644 index 0000000..62d67cc --- /dev/null +++ b/docs/StaleFlagSettingValueModel.md @@ -0,0 +1,15 @@ + + +# StaleFlagSettingValueModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**environmentId** | **UUID** | Identifier of the Environment. | | +|**updatedAt** | **OffsetDateTime** | The last updated date and time when the Feature Flag or Setting. | | +|**isStale** | **Boolean** | Is the feature flag considered stale in the environment. | | + + + diff --git a/docs/StaleFlagStaleInEnvironmentsType.md b/docs/StaleFlagStaleInEnvironmentsType.md new file mode 100644 index 0000000..b006561 --- /dev/null +++ b/docs/StaleFlagStaleInEnvironmentsType.md @@ -0,0 +1,13 @@ + + +# StaleFlagStaleInEnvironmentsType + +## Enum + + +* `STALE_IN_ANY_ENVIRONMENTS` (value: `"staleInAnyEnvironments"`) + +* `STALE_IN_ALL_ENVIRONMENTS` (value: `"staleInAllEnvironments"`) + + + diff --git a/docs/TagModel.md b/docs/TagModel.md index 6a5764b..dac91eb 100644 --- a/docs/TagModel.md +++ b/docs/TagModel.md @@ -7,10 +7,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**product** | [**ProductModel**](ProductModel.md) | | [optional] | -|**tagId** | **Long** | Identifier of the Tag. | [optional] | -|**name** | **String** | Name of the Tag. | [optional] | -|**color** | **String** | The configured color of the Tag. | [optional] | +|**product** | [**ProductModel**](ProductModel.md) | | | +|**tagId** | **Long** | Identifier of the Tag. | | +|**name** | **String** | Name of the Tag. | | +|**color** | **String** | The configured color of the Tag. | | diff --git a/docs/TargetingRuleModel.md b/docs/TargetingRuleModel.md index d26b4a0..720d7f1 100644 --- a/docs/TargetingRuleModel.md +++ b/docs/TargetingRuleModel.md @@ -7,9 +7,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**conditions** | [**List<ConditionModel>**](ConditionModel.md) | The list of conditions that are combined with logical AND operators. It can be one of the following: - User condition - Segment condition - Prerequisite flag condition | [optional] | -|**percentageOptions** | [**List<PercentageOptionModel>**](PercentageOptionModel.md) | The percentage options from where the evaluation process will choose a value based on the flag's percentage evaluation attribute. | [optional] | -|**value** | [**ValueModel**](ValueModel.md) | | [optional] | +|**conditions** | [**List<ConditionModel>**](ConditionModel.md) | The list of conditions that are combined with logical AND operators. It can be one of the following: - User condition - Segment condition - Prerequisite flag condition | | +|**percentageOptions** | [**List<PercentageOptionModel>**](PercentageOptionModel.md) | The percentage options from where the evaluation process will choose a value based on the flag's percentage evaluation attribute. | | +|**value** | [**ValueModel**](ValueModel.md) | | | diff --git a/docs/UpdateComparisonValueListModel.md b/docs/UpdateComparisonValueListModel.md new file mode 100644 index 0000000..4f92313 --- /dev/null +++ b/docs/UpdateComparisonValueListModel.md @@ -0,0 +1,14 @@ + + +# UpdateComparisonValueListModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**value** | **String** | The actual comparison value. | | +|**hint** | **String** | An optional hint for the comparison value. | [optional] | + + + diff --git a/docs/UpdateComparisonValueModel.md b/docs/UpdateComparisonValueModel.md new file mode 100644 index 0000000..77c687d --- /dev/null +++ b/docs/UpdateComparisonValueModel.md @@ -0,0 +1,16 @@ + + +# UpdateComparisonValueModel + +The value that the user object's attribute is compared to. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**stringValue** | **String** | The string representation of the comparison value. | [optional] | +|**doubleValue** | **Double** | The number representation of the comparison value. | [optional] | +|**listValue** | [**List<UpdateComparisonValueListModel>**](UpdateComparisonValueListModel.md) | The list representation of the comparison value. | [optional] | + + + diff --git a/docs/UpdateConditionModel.md b/docs/UpdateConditionModel.md new file mode 100644 index 0000000..caef729 --- /dev/null +++ b/docs/UpdateConditionModel.md @@ -0,0 +1,15 @@ + + +# UpdateConditionModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userCondition** | [**UpdateUserConditionModel**](UpdateUserConditionModel.md) | | [optional] | +|**segmentCondition** | [**UpdateSegmentConditionModel**](UpdateSegmentConditionModel.md) | | [optional] | +|**prerequisiteFlagCondition** | [**UpdatePrerequisiteFlagConditionModel**](UpdatePrerequisiteFlagConditionModel.md) | | [optional] | + + + diff --git a/docs/UpdateConfigRequest.md b/docs/UpdateConfigRequest.md index 97dff79..574d98e 100644 --- a/docs/UpdateConfigRequest.md +++ b/docs/UpdateConfigRequest.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**name** | **String** | The name of the Config. | [optional] | |**description** | **String** | The description of the Config. | [optional] | -|**order** | **Integer** | The order of the Config represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | +|**order** | **Integer** | The order of the Config represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | diff --git a/docs/UpdateEnvironmentModel.md b/docs/UpdateEnvironmentModel.md index 0628a03..3eb603e 100644 --- a/docs/UpdateEnvironmentModel.md +++ b/docs/UpdateEnvironmentModel.md @@ -10,7 +10,7 @@ |**name** | **String** | The name of the Environment. | [optional] | |**color** | **String** | The color of the Environment. RGB or HTML color codes are allowed. | [optional] | |**description** | **String** | The description of the Environment. | [optional] | -|**order** | **Integer** | The order of the Environment represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | +|**order** | **Integer** | The order of the Environment represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | diff --git a/docs/UpdateEvaluationFormulaModel.md b/docs/UpdateEvaluationFormulaModel.md index 853fa7b..b53cabd 100644 --- a/docs/UpdateEvaluationFormulaModel.md +++ b/docs/UpdateEvaluationFormulaModel.md @@ -7,8 +7,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**defaultValue** | [**ValueModel**](ValueModel.md) | | | -|**targetingRules** | [**List<TargetingRuleModel>**](TargetingRuleModel.md) | The targeting rules of the Feature Flag or Setting. | [optional] | +|**defaultValue** | [**UpdateValueModel**](UpdateValueModel.md) | | | +|**targetingRules** | [**List<UpdateTargetingRuleModel>**](UpdateTargetingRuleModel.md) | The targeting rules of the Feature Flag or Setting. | [optional] | |**percentageEvaluationAttribute** | **String** | The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. | [optional] | diff --git a/docs/UpdateEvaluationFormulaWithIdModel.md b/docs/UpdateEvaluationFormulaWithIdModel.md index 97353de..fb53285 100644 --- a/docs/UpdateEvaluationFormulaWithIdModel.md +++ b/docs/UpdateEvaluationFormulaWithIdModel.md @@ -7,8 +7,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**defaultValue** | [**ValueModel**](ValueModel.md) | | | -|**targetingRules** | [**List<TargetingRuleModel>**](TargetingRuleModel.md) | The targeting rules of the Feature Flag or Setting. | [optional] | +|**defaultValue** | [**UpdateValueModel**](UpdateValueModel.md) | | | +|**targetingRules** | [**List<UpdateTargetingRuleModel>**](UpdateTargetingRuleModel.md) | The targeting rules of the Feature Flag or Setting. | [optional] | |**percentageEvaluationAttribute** | **String** | The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. | [optional] | |**settingId** | **Integer** | The identifier of the feature flag or setting. | [optional] | diff --git a/docs/UpdatePercentageOptionModel.md b/docs/UpdatePercentageOptionModel.md new file mode 100644 index 0000000..69afbff --- /dev/null +++ b/docs/UpdatePercentageOptionModel.md @@ -0,0 +1,14 @@ + + +# UpdatePercentageOptionModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**percentage** | **Integer** | A number between 0 and 100 that represents a randomly allocated fraction of the users. | | +|**value** | [**UpdateValueModel**](UpdateValueModel.md) | | | + + + diff --git a/docs/UpdatePrerequisiteFlagConditionModel.md b/docs/UpdatePrerequisiteFlagConditionModel.md new file mode 100644 index 0000000..0c1ec5c --- /dev/null +++ b/docs/UpdatePrerequisiteFlagConditionModel.md @@ -0,0 +1,16 @@ + + +# UpdatePrerequisiteFlagConditionModel + +Describes a condition that is based on a prerequisite flag. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**prerequisiteSettingId** | **Integer** | The prerequisite flag's identifier. | | +|**comparator** | **PrerequisiteComparator** | | | +|**prerequisiteComparisonValue** | [**UpdateValueModel**](UpdateValueModel.md) | | | + + + diff --git a/docs/UpdateProductRequest.md b/docs/UpdateProductRequest.md index 27326a7..64b5060 100644 --- a/docs/UpdateProductRequest.md +++ b/docs/UpdateProductRequest.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**name** | **String** | The name of the Product. | [optional] | |**description** | **String** | The description of the Product. | [optional] | -|**order** | **Integer** | The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | +|**order** | **Integer** | The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | diff --git a/docs/UpdateRolloutPercentageItemModel.md b/docs/UpdateRolloutPercentageItemModel.md new file mode 100644 index 0000000..a765c9f --- /dev/null +++ b/docs/UpdateRolloutPercentageItemModel.md @@ -0,0 +1,14 @@ + + +# UpdateRolloutPercentageItemModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**percentage** | **Long** | The percentage value for the rule. | | +|**value** | [**SettingValueType**](SettingValueType.md) | The value to serve when the user falls in the percentage rule. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. | | + + + diff --git a/docs/UpdateRolloutRuleModel.md b/docs/UpdateRolloutRuleModel.md new file mode 100644 index 0000000..177be9e --- /dev/null +++ b/docs/UpdateRolloutRuleModel.md @@ -0,0 +1,18 @@ + + +# UpdateRolloutRuleModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**comparisonAttribute** | **String** | The user attribute to compare. | [optional] | +|**comparator** | **RolloutRuleComparator** | | [optional] | +|**comparisonValue** | **String** | The value to compare against. | [optional] | +|**value** | [**SettingValueType**](SettingValueType.md) | The value to serve when the comparison matches. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. | | +|**segmentComparator** | **SegmentComparator** | | [optional] | +|**segmentId** | **UUID** | The segment to compare against. | [optional] | + + + diff --git a/docs/UpdateSegmentConditionModel.md b/docs/UpdateSegmentConditionModel.md new file mode 100644 index 0000000..5677d16 --- /dev/null +++ b/docs/UpdateSegmentConditionModel.md @@ -0,0 +1,15 @@ + + +# UpdateSegmentConditionModel + +Describes a condition that is based on a segment. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**segmentId** | **UUID** | The segment's identifier. | | +|**comparator** | **SegmentComparator** | | | + + + diff --git a/docs/UpdateSettingValueModel.md b/docs/UpdateSettingValueModel.md index 1f70ab1..41416af 100644 --- a/docs/UpdateSettingValueModel.md +++ b/docs/UpdateSettingValueModel.md @@ -7,9 +7,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**rolloutRules** | [**List<RolloutRuleModel>**](RolloutRuleModel.md) | The targeting rule collection. | [optional] | -|**rolloutPercentageItems** | [**List<RolloutPercentageItemModel>**](RolloutPercentageItemModel.md) | The percentage rule collection. | [optional] | -|**value** | **Object** | The value to serve. It must respect the setting type. | [optional] | +|**rolloutRules** | [**List<UpdateRolloutRuleModel>**](UpdateRolloutRuleModel.md) | The targeting rule collection. | [optional] | +|**rolloutPercentageItems** | [**List<UpdateRolloutPercentageItemModel>**](UpdateRolloutPercentageItemModel.md) | The percentage rule collection. | [optional] | +|**value** | [**SettingValueType**](SettingValueType.md) | The value to serve. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. | | diff --git a/docs/UpdateSettingValueWithSettingIdModel.md b/docs/UpdateSettingValueWithSettingIdModel.md index 9915b44..56275db 100644 --- a/docs/UpdateSettingValueWithSettingIdModel.md +++ b/docs/UpdateSettingValueWithSettingIdModel.md @@ -7,9 +7,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**rolloutRules** | [**List<RolloutRuleModel>**](RolloutRuleModel.md) | The targeting rule collection. | [optional] | -|**rolloutPercentageItems** | [**List<RolloutPercentageItemModel>**](RolloutPercentageItemModel.md) | The percentage rule collection. | [optional] | -|**value** | **Object** | The value to serve. It must respect the setting type. | [optional] | +|**rolloutRules** | [**List<UpdateRolloutRuleModel>**](UpdateRolloutRuleModel.md) | The targeting rule collection. | [optional] | +|**rolloutPercentageItems** | [**List<UpdateRolloutPercentageItemModel>**](UpdateRolloutPercentageItemModel.md) | The percentage rule collection. | [optional] | +|**value** | [**SettingValueType**](SettingValueType.md) | The value to serve. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. | | |**settingId** | **Integer** | The id of the Setting. | [optional] | diff --git a/docs/UpdateTargetingRuleModel.md b/docs/UpdateTargetingRuleModel.md new file mode 100644 index 0000000..1efb51a --- /dev/null +++ b/docs/UpdateTargetingRuleModel.md @@ -0,0 +1,15 @@ + + +# UpdateTargetingRuleModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**conditions** | [**List<UpdateConditionModel>**](UpdateConditionModel.md) | The list of conditions that are combined with logical AND operators. It can be one of the following: - User condition - Segment condition - Prerequisite flag condition | [optional] | +|**percentageOptions** | [**List<UpdatePercentageOptionModel>**](UpdatePercentageOptionModel.md) | The percentage options from where the evaluation process will choose a value based on the flag's percentage evaluation attribute. | [optional] | +|**value** | [**UpdateValueModel**](UpdateValueModel.md) | | [optional] | + + + diff --git a/docs/UpdateUserConditionModel.md b/docs/UpdateUserConditionModel.md new file mode 100644 index 0000000..72bb188 --- /dev/null +++ b/docs/UpdateUserConditionModel.md @@ -0,0 +1,16 @@ + + +# UpdateUserConditionModel + +Describes a condition that is based on user attributes. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**comparisonAttribute** | **String** | The User Object attribute that the condition is based on. Can be \"User ID\", \"Email\", \"Country\" or any custom attribute. | | +|**comparator** | **UserComparator** | | | +|**comparisonValue** | [**UpdateComparisonValueModel**](UpdateComparisonValueModel.md) | | | + + + diff --git a/docs/UpdateValueModel.md b/docs/UpdateValueModel.md new file mode 100644 index 0000000..074026c --- /dev/null +++ b/docs/UpdateValueModel.md @@ -0,0 +1,17 @@ + + +# UpdateValueModel + +Represents the value of a Feature Flag or Setting. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**boolValue** | **Boolean** | The served value in case of a boolean Feature Flag. | [optional] | +|**stringValue** | **String** | The served value in case of a text Setting. | [optional] | +|**intValue** | **Integer** | The served value in case of a whole number Setting. | [optional] | +|**doubleValue** | **Double** | The served value in case of a decimal number Setting. | [optional] | + + + diff --git a/docs/UserModel.md b/docs/UserModel.md index 9783892..baef0f4 100644 --- a/docs/UserModel.md +++ b/docs/UserModel.md @@ -7,10 +7,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**userId** | **String** | Identifier of the Member. | [optional] | -|**fullName** | **String** | Name of the Member. | [optional] | -|**email** | **String** | Email of the Member. | [optional] | -|**twoFactorEnabled** | **Boolean** | Determines whether 2FA is enabled for the Member. | [optional] | +|**userId** | **String** | Identifier of the Member. | | +|**fullName** | **String** | Name of the Member. | | +|**email** | **String** | Email of the Member. | | +|**twoFactorEnabled** | **Boolean** | Determines whether 2FA is enabled for the Member. | | diff --git a/docs/ValueModel.md b/docs/ValueModel.md index 775dcd4..61730f8 100644 --- a/docs/ValueModel.md +++ b/docs/ValueModel.md @@ -8,10 +8,10 @@ Represents the value of a Feature Flag or Setting. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**boolValue** | **Boolean** | The served value in case of a boolean Feature Flag. | [optional] | -|**stringValue** | **String** | The served value in case of a text Setting. | [optional] | -|**intValue** | **Integer** | The served value in case of a whole number Setting. | [optional] | -|**doubleValue** | **Double** | The served value in case of a decimal number Setting. | [optional] | +|**boolValue** | **Boolean** | The served value in case of a boolean Feature Flag. | | +|**stringValue** | **String** | The served value in case of a text Setting. | | +|**intValue** | **Integer** | The served value in case of a whole number Setting. | | +|**doubleValue** | **Double** | The served value in case of a decimal number Setting. | | diff --git a/docs/WebHookRequest.md b/docs/WebHookRequestModel.md similarity index 95% rename from docs/WebHookRequest.md rename to docs/WebHookRequestModel.md index 7591a3c..b382789 100644 --- a/docs/WebHookRequest.md +++ b/docs/WebHookRequestModel.md @@ -1,6 +1,6 @@ -# WebHookRequest +# WebHookRequestModel ## Properties diff --git a/docs/WebhookConfig.md b/docs/WebhookConfig.md index 04150ea..2199136 100644 --- a/docs/WebhookConfig.md +++ b/docs/WebhookConfig.md @@ -8,8 +8,8 @@ The Config where the applied changes will invoke the Webhook. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**name** | **String** | The Config's name. | [optional] | -|**configId** | **UUID** | The Config's identifier. | [optional] | +|**name** | **String** | The Config's name. | | +|**configId** | **UUID** | The Config's identifier. | | diff --git a/docs/WebhookEnvironment.md b/docs/WebhookEnvironment.md index 1101752..3a40a29 100644 --- a/docs/WebhookEnvironment.md +++ b/docs/WebhookEnvironment.md @@ -8,8 +8,8 @@ The Environment where the applied changes will invoke the Webhook. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**name** | **String** | The Environment's name. | [optional] | -|**environmentId** | **UUID** | The Environment's identifier. | [optional] | +|**name** | **String** | The Environment's name. | | +|**environmentId** | **UUID** | The Environment's identifier. | | diff --git a/docs/WebhookHeaderResponseModel.md b/docs/WebhookHeaderResponseModel.md new file mode 100644 index 0000000..ce1771c --- /dev/null +++ b/docs/WebhookHeaderResponseModel.md @@ -0,0 +1,15 @@ + + +# WebhookHeaderResponseModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**key** | **String** | The HTTP header key. | | +|**value** | **String** | The HTTP header value. | | +|**isSecure** | **Boolean** | Indicates whether the header value is sensitive. | | + + + diff --git a/docs/WebhookModel.md b/docs/WebhookModel.md deleted file mode 100644 index 8a83ee0..0000000 --- a/docs/WebhookModel.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# WebhookModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**webhookId** | **Integer** | The identifier of the Webhook. | [optional] | -|**url** | **String** | The URL of the Webhook. | [optional] | -|**httpMethod** | **WebHookHttpMethod** | | [optional] | -|**content** | **String** | The HTTP body content. | [optional] | -|**webHookHeaders** | [**List<WebhookHeaderModel>**](WebhookHeaderModel.md) | List of HTTP headers that the Webhook must send. | [optional] | -|**config** | [**WebhookConfig**](WebhookConfig.md) | | [optional] | -|**environment** | [**WebhookEnvironment**](WebhookEnvironment.md) | | [optional] | - - - diff --git a/docs/WebhookResponseModel.md b/docs/WebhookResponseModel.md new file mode 100644 index 0000000..b2bde53 --- /dev/null +++ b/docs/WebhookResponseModel.md @@ -0,0 +1,19 @@ + + +# WebhookResponseModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**webhookId** | **Integer** | The identifier of the Webhook. | | +|**url** | **String** | The URL of the Webhook. | | +|**httpMethod** | **WebHookHttpMethod** | | | +|**content** | **String** | The HTTP body content. | | +|**webHookHeaders** | [**List<WebhookHeaderResponseModel>**](WebhookHeaderResponseModel.md) | List of HTTP headers that the Webhook must send. | | +|**config** | [**WebhookConfig**](WebhookConfig.md) | | | +|**environment** | [**WebhookEnvironment**](WebhookEnvironment.md) | | | + + + diff --git a/docs/WebhookSigningKeysModel.md b/docs/WebhookSigningKeysModel.md index eb56f9c..80b1273 100644 --- a/docs/WebhookSigningKeysModel.md +++ b/docs/WebhookSigningKeysModel.md @@ -7,8 +7,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**key1** | **String** | The first signing key. | [optional] | -|**key2** | **String** | The second signing key. | [optional] | +|**key1** | **String** | The first signing key. | | +|**key2** | **String** | The second signing key. | | diff --git a/docs/WebhooksApi.md b/docs/WebhooksApi.md index 8373df2..1643e63 100644 --- a/docs/WebhooksApi.md +++ b/docs/WebhooksApi.md @@ -15,7 +15,7 @@ All URIs are relative to *https://api.configcat.com* # **createWebhook** -> WebhookModel createWebhook(configId, environmentId, webHookRequest) +> WebhookResponseModel createWebhook(configId, environmentId, webHookRequestModel) Create Webhook @@ -44,9 +44,9 @@ public class Example { WebhooksApi apiInstance = new WebhooksApi(defaultClient); UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - WebHookRequest webHookRequest = new WebHookRequest(); // WebHookRequest | + WebHookRequestModel webHookRequestModel = new WebHookRequestModel(); // WebHookRequestModel | try { - WebhookModel result = apiInstance.createWebhook(configId, environmentId, webHookRequest); + WebhookResponseModel result = apiInstance.createWebhook(configId, environmentId, webHookRequestModel); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling WebhooksApi#createWebhook"); @@ -65,11 +65,11 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **configId** | **UUID**| The identifier of the Config. | | | **environmentId** | **UUID**| The identifier of the Environment. | | -| **webHookRequest** | [**WebHookRequest**](WebHookRequest.md)| | | +| **webHookRequestModel** | [**WebHookRequestModel**](WebHookRequestModel.md)| | | ### Return type -[**WebhookModel**](WebhookModel.md) +[**WebhookResponseModel**](WebhookResponseModel.md) ### Authorization @@ -160,7 +160,7 @@ null (empty response body) # **getWebhook** -> WebhookModel getWebhook(webhookId) +> WebhookResponseModel getWebhook(webhookId) Get Webhook @@ -189,7 +189,7 @@ public class Example { WebhooksApi apiInstance = new WebhooksApi(defaultClient); Integer webhookId = 56; // Integer | The identifier of the Webhook. try { - WebhookModel result = apiInstance.getWebhook(webhookId); + WebhookResponseModel result = apiInstance.getWebhook(webhookId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling WebhooksApi#getWebhook"); @@ -210,7 +210,7 @@ public class Example { ### Return type -[**WebhookModel**](WebhookModel.md) +[**WebhookResponseModel**](WebhookResponseModel.md) ### Authorization @@ -302,7 +302,7 @@ public class Example { # **getWebhooks** -> List<WebhookModel> getWebhooks(productId) +> List<WebhookResponseModel> getWebhooks(productId) List Webhooks @@ -331,7 +331,7 @@ public class Example { WebhooksApi apiInstance = new WebhooksApi(defaultClient); UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. try { - List result = apiInstance.getWebhooks(productId); + List result = apiInstance.getWebhooks(productId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling WebhooksApi#getWebhooks"); @@ -352,7 +352,7 @@ public class Example { ### Return type -[**List<WebhookModel>**](WebhookModel.md) +[**List<WebhookResponseModel>**](WebhookResponseModel.md) ### Authorization @@ -371,7 +371,7 @@ public class Example { # **replaceWebhook** -> WebhookModel replaceWebhook(webhookId, webHookRequest) +> WebhookResponseModel replaceWebhook(webhookId, webHookRequestModel) Replace Webhook @@ -399,9 +399,9 @@ public class Example { WebhooksApi apiInstance = new WebhooksApi(defaultClient); Integer webhookId = 56; // Integer | The identifier of the Webhook. - WebHookRequest webHookRequest = new WebHookRequest(); // WebHookRequest | + WebHookRequestModel webHookRequestModel = new WebHookRequestModel(); // WebHookRequestModel | try { - WebhookModel result = apiInstance.replaceWebhook(webhookId, webHookRequest); + WebhookResponseModel result = apiInstance.replaceWebhook(webhookId, webHookRequestModel); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling WebhooksApi#replaceWebhook"); @@ -419,11 +419,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **webhookId** | **Integer**| The identifier of the Webhook. | | -| **webHookRequest** | [**WebHookRequest**](WebHookRequest.md)| | | +| **webHookRequestModel** | [**WebHookRequestModel**](WebHookRequestModel.md)| | | ### Return type -[**WebhookModel**](WebhookModel.md) +[**WebhookResponseModel**](WebhookResponseModel.md) ### Authorization @@ -444,7 +444,7 @@ public class Example { # **updateWebhook** -> WebhookModel updateWebhook(webhookId, jsonPatchOperation) +> WebhookResponseModel updateWebhook(webhookId, jsonPatchOperation) Update Webhook @@ -474,7 +474,7 @@ public class Example { Integer webhookId = 56; // Integer | The identifier of the Webhook. List jsonPatchOperation = Arrays.asList(); // List | try { - WebhookModel result = apiInstance.updateWebhook(webhookId, jsonPatchOperation); + WebhookResponseModel result = apiInstance.updateWebhook(webhookId, jsonPatchOperation); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling WebhooksApi#updateWebhook"); @@ -496,7 +496,7 @@ public class Example { ### Return type -[**WebhookModel**](WebhookModel.md) +[**WebhookResponseModel**](WebhookResponseModel.md) ### Authorization diff --git a/docs/ZombieStaleFlagsApi.md b/docs/ZombieStaleFlagsApi.md new file mode 100644 index 0000000..0d194cc --- /dev/null +++ b/docs/ZombieStaleFlagsApi.md @@ -0,0 +1,90 @@ +# ZombieStaleFlagsApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getStaleflags**](ZombieStaleFlagsApi.md#getStaleflags) | **GET** /v1/products/{productId}/staleflags | List Zombie (stale) flags for Product | + + + +# **getStaleflags** +> StaleFlagProductModel getStaleflags(productId, scope, staleFlagAgeDays, staleFlagStaleInEnvironmentsType, ignoredEnvironmentIds, ignoredTagIds) + +List Zombie (stale) flags for Product + +This endpoint returns the list of Zombie (stale) flags for a given Product and the result can be optionally filtered by various parameters. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.ZombieStaleFlagsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + ZombieStaleFlagsApi apiInstance = new ZombieStaleFlagsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + StaleFlagReminderScope scope = StaleFlagReminderScope.fromValue("all"); // StaleFlagReminderScope | The scope of the report. + Integer staleFlagAgeDays = 56; // Integer | The inactivity in days after a feature flag should be considered stale. + StaleFlagStaleInEnvironmentsType staleFlagStaleInEnvironmentsType = StaleFlagStaleInEnvironmentsType.fromValue("staleInAnyEnvironments"); // StaleFlagStaleInEnvironmentsType | Consider a feature flag as stale if the feature flag is stale in all/any of the environments. + List ignoredEnvironmentIds = Arrays.asList(); // List | Ignore environment identifiers from the report. + List ignoredTagIds = Arrays.asList(); // List | Ignore feature flags from the report based on their tag identifiers. + try { + StaleFlagProductModel result = apiInstance.getStaleflags(productId, scope, staleFlagAgeDays, staleFlagStaleInEnvironmentsType, ignoredEnvironmentIds, ignoredTagIds); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ZombieStaleFlagsApi#getStaleflags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | +| **scope** | [**StaleFlagReminderScope**](.md)| The scope of the report. | [optional] [enum: all, watchedByMe] | +| **staleFlagAgeDays** | **Integer**| The inactivity in days after a feature flag should be considered stale. | [optional] | +| **staleFlagStaleInEnvironmentsType** | [**StaleFlagStaleInEnvironmentsType**](.md)| Consider a feature flag as stale if the feature flag is stale in all/any of the environments. | [optional] [enum: staleInAnyEnvironments, staleInAllEnvironments] | +| **ignoredEnvironmentIds** | [**List<UUID>**](UUID.md)| Ignore environment identifiers from the report. | [optional] | +| **ignoredTagIds** | [**List<Long>**](Long.md)| Ignore feature flags from the report based on their tag identifiers. | [optional] | + +### Return type + +[**StaleFlagProductModel**](StaleFlagProductModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/src/main/java/com/configcat/publicapi/java/client/ApiException.java b/src/main/java/com/configcat/publicapi/java/client/ApiException.java index 3ea6ea1..36ddb79 100644 --- a/src/main/java/com/configcat/publicapi/java/client/ApiException.java +++ b/src/main/java/com/configcat/publicapi/java/client/ApiException.java @@ -21,7 +21,7 @@ *

ApiException class.

*/ @SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class ApiException extends RuntimeException { private static final long serialVersionUID = 1L; 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 c6baed3..7c60a8c 100644 --- a/src/main/java/com/configcat/publicapi/java/client/Configuration.java +++ b/src/main/java/com/configcat/publicapi/java/client/Configuration.java @@ -13,7 +13,7 @@ package com.configcat.publicapi.java.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class Configuration { public static final String VERSION = "v1"; 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..305ac6f 100644 --- a/src/main/java/com/configcat/publicapi/java/client/JSON.java +++ b/src/main/java/com/configcat/publicapi/java/client/JSON.java @@ -118,6 +118,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CreateTagModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.DeleteIntegrationLinkModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.DeleteRepositoryReportsRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.DeletedSettingModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.EnvironmentAccessModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.EnvironmentModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.FeatureFlagLimitations.CustomTypeAdapterFactory()); @@ -148,8 +149,10 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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.ReferenceLineModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ReferenceLineRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ReferenceLinesModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ReferenceLinesRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ReplaceSettingModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.RolloutPercentageItemModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.RolloutRuleModel.CustomTypeAdapterFactory()); @@ -162,31 +165,50 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SettingModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SettingTagModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SettingValueModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SettingValueType.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.StaleFlagConfigModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.StaleFlagEnvironmentModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.StaleFlagProductModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.StaleFlagSettingModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.StaleFlagSettingTagModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.StaleFlagSettingValueModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.TagModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.TargetingRuleModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateComparisonValueListModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateComparisonValueModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateConditionModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateConfigRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateEnvironmentModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateEvaluationFormulaModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateEvaluationFormulaWithIdModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateEvaluationFormulasModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateMemberPermissionsRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdatePercentageOptionModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdatePermissionGroupRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdatePreferencesRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdatePrerequisiteFlagConditionModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateProductRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateReasonRequiredEnvironmentModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateRolloutPercentageItemModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateRolloutRuleModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateSegmentConditionModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateSegmentModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateSettingValueModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateSettingValueWithSettingIdModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateSettingValuesWithIdModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateTagModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateTargetingRuleModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateUserConditionModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateValueModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UserConditionModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UserModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ValueModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebHookRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebHookRequestModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebhookConfig.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebhookEnvironment.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebhookHeaderModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebhookModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebhookHeaderResponseModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebhookResponseModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebhookSigningKeysModel.CustomTypeAdapterFactory()); gson = gsonBuilder.create(); } 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 8a854a2..e46360b 100644 --- a/src/main/java/com/configcat/publicapi/java/client/Pair.java +++ b/src/main/java/com/configcat/publicapi/java/client/Pair.java @@ -13,7 +13,7 @@ package com.configcat.publicapi.java.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class Pair { private String name = ""; private String value = ""; 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 935cc91..75073ca 100644 --- a/src/main/java/com/configcat/publicapi/java/client/ServerConfiguration.java +++ b/src/main/java/com/configcat/publicapi/java/client/ServerConfiguration.java @@ -5,7 +5,7 @@ /** * Representing a Server configuration. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class ServerConfiguration { public String URL; public String description; 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 642d8ea..ea17331 100644 --- a/src/main/java/com/configcat/publicapi/java/client/ServerVariable.java +++ b/src/main/java/com/configcat/publicapi/java/client/ServerVariable.java @@ -5,7 +5,7 @@ /** * Representing a Server Variable for server URL template substitution. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class ServerVariable { public String description; public String defaultValue; 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 0662de4..bee1164 100644 --- a/src/main/java/com/configcat/publicapi/java/client/StringUtil.java +++ b/src/main/java/com/configcat/publicapi/java/client/StringUtil.java @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). 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 2d303c9..e6a8aec 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 @@ -29,8 +29,8 @@ import com.configcat.publicapi.java.client.model.AuditLogItemModel; import com.configcat.publicapi.java.client.model.AuditLogType; +import com.configcat.publicapi.java.client.model.DeletedSettingModel; import java.time.OffsetDateTime; -import com.configcat.publicapi.java.client.model.SettingModel; import java.util.UUID; import java.lang.reflect.Type; @@ -174,7 +174,7 @@ private okhttp3.Call getAuditlogsValidateBeforeCall(UUID productId, UUID configI /** * 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. + * This endpoint returns the list of Audit log items for a given Product and the result can be optionally filtered by Config and/or Environment. If neither `fromUtcDateTime` nor `toUtcDateTime` is set, the audit logs for the **last 7 days** will be returned. The distance between `fromUtcDateTime` and `toUtcDateTime` cannot exceed **30 days**. * @param productId The identifier of the Product. (required) * @param configId The identifier of the Config. (optional) * @param environmentId The identifier of the Environment. (optional) @@ -199,7 +199,7 @@ public List getAuditlogs(UUID productId, UUID configId, UUID /** * 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. + * This endpoint returns the list of Audit log items for a given Product and the result can be optionally filtered by Config and/or Environment. If neither `fromUtcDateTime` nor `toUtcDateTime` is set, the audit logs for the **last 7 days** will be returned. The distance between `fromUtcDateTime` and `toUtcDateTime` cannot exceed **30 days**. * @param productId The identifier of the Product. (required) * @param configId The identifier of the Config. (optional) * @param environmentId The identifier of the Environment. (optional) @@ -225,7 +225,7 @@ public ApiResponse> getAuditlogsWithHttpInfo(UUID produc /** * 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. + * This endpoint returns the list of Audit log items for a given Product and the result can be optionally filtered by Config and/or Environment. If neither `fromUtcDateTime` nor `toUtcDateTime` is set, the audit logs for the **last 7 days** will be returned. The distance between `fromUtcDateTime` and `toUtcDateTime` cannot exceed **30 days**. * @param productId The identifier of the Product. (required) * @param configId The identifier of the Config. (optional) * @param environmentId The identifier of the Environment. (optional) @@ -326,7 +326,7 @@ private okhttp3.Call getDeletedSettingsValidateBeforeCall(UUID configId, final A * 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> + * @return List<DeletedSettingModel> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -337,8 +337,8 @@ private okhttp3.Call getDeletedSettingsValidateBeforeCall(UUID configId, final A
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); + public List getDeletedSettings(UUID configId) throws ApiException { + ApiResponse> localVarResp = getDeletedSettingsWithHttpInfo(configId); return localVarResp.getData(); } @@ -346,7 +346,7 @@ 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. * @param configId The identifier of the Config. (required) - * @return ApiResponse<List<SettingModel>> + * @return ApiResponse<List<DeletedSettingModel>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -357,9 +357,9 @@ public List getDeletedSettings(UUID configId) throws ApiException
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); } @@ -379,10 +379,10 @@ public ApiResponse> getDeletedSettingsWithHttpInfo(UUID confi 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; } @@ -489,7 +489,7 @@ private okhttp3.Call getOrganizationAuditlogsValidateBeforeCall(UUID organizatio /** * 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. + * This endpoint returns the list of Audit log items for a given Organization and the result can be optionally filtered by Product and/or Config and/or Environment. If neither `fromUtcDateTime` nor `toUtcDateTime` is set, the audit logs for the **last 7 days** will be returned. The distance between `fromUtcDateTime` and `toUtcDateTime` cannot exceed **30 days**. * @param organizationId The identifier of the Organization. (required) * @param productId The identifier of the Product. (optional) * @param configId The identifier of the Config. (optional) @@ -515,7 +515,7 @@ public List getOrganizationAuditlogs(UUID organizationId, UUI /** * 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. + * This endpoint returns the list of Audit log items for a given Organization and the result can be optionally filtered by Product and/or Config and/or Environment. If neither `fromUtcDateTime` nor `toUtcDateTime` is set, the audit logs for the **last 7 days** will be returned. The distance between `fromUtcDateTime` and `toUtcDateTime` cannot exceed **30 days**. * @param organizationId The identifier of the Organization. (required) * @param productId The identifier of the Product. (optional) * @param configId The identifier of the Config. (optional) @@ -542,7 +542,7 @@ public ApiResponse> getOrganizationAuditlogsWithHttpInfo /** * 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. + * This endpoint returns the list of Audit log items for a given Organization and the result can be optionally filtered by Product and/or Config and/or Environment. If neither `fromUtcDateTime` nor `toUtcDateTime` is set, the audit logs for the **last 7 days** will be returned. The distance between `fromUtcDateTime` and `toUtcDateTime` cannot exceed **30 days**. * @param organizationId The identifier of the Organization. (required) * @param productId The identifier of the Product. (optional) * @param configId The identifier of the Config. (optional) 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..8bacf7d 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 @@ -29,8 +29,8 @@ 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.WebHookRequestModel; +import com.configcat.publicapi.java.client.model.WebhookResponseModel; import com.configcat.publicapi.java.client.model.WebhookSigningKeysModel; import java.lang.reflect.Type; @@ -80,7 +80,7 @@ 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 webHookRequestModel (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -93,7 +93,7 @@ public void setCustomBaseUrl(String customBaseUrl) { 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, WebHookRequestModel webHookRequestModel, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -107,7 +107,7 @@ public okhttp3.Call createWebhookCall(UUID configId, UUID environmentId, WebHook basePath = null; } - Object localVarPostBody = webHookRequest; + Object localVarPostBody = webHookRequestModel; // create path and map variables String localVarPath = "/v1/configs/{configId}/environments/{environmentId}/webhooks" @@ -143,7 +143,7 @@ public okhttp3.Call createWebhookCall(UUID configId, UUID environmentId, WebHook } @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, WebHookRequestModel webHookRequestModel, final ApiCallback _callback) throws ApiException { // verify the required parameter 'configId' is set if (configId == null) { throw new ApiException("Missing the required parameter 'configId' when calling createWebhook(Async)"); @@ -154,12 +154,12 @@ private okhttp3.Call createWebhookValidateBeforeCall(UUID configId, UUID environ 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)"); + // verify the required parameter 'webHookRequestModel' is set + if (webHookRequestModel == null) { + throw new ApiException("Missing the required parameter 'webHookRequestModel' when calling createWebhook(Async)"); } - return createWebhookCall(configId, environmentId, webHookRequest, _callback); + return createWebhookCall(configId, environmentId, webHookRequestModel, _callback); } @@ -168,8 +168,8 @@ private okhttp3.Call createWebhookValidateBeforeCall(UUID configId, UUID environ * This endpoint creates a new Webhook in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. * @param configId The identifier of the Config. (required) * @param environmentId The identifier of the Environment. (required) - * @param webHookRequest (required) - * @return WebhookModel + * @param webHookRequestModel (required) + * @return WebhookResponseModel * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -180,8 +180,8 @@ private okhttp3.Call createWebhookValidateBeforeCall(UUID configId, UUID environ
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 WebhookResponseModel createWebhook(UUID configId, UUID environmentId, WebHookRequestModel webHookRequestModel) throws ApiException { + ApiResponse localVarResp = createWebhookWithHttpInfo(configId, environmentId, webHookRequestModel); return localVarResp.getData(); } @@ -190,8 +190,8 @@ public WebhookModel createWebhook(UUID configId, UUID environmentId, WebHookRequ * This endpoint creates a new Webhook in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. * @param configId The identifier of the Config. (required) * @param environmentId The identifier of the Environment. (required) - * @param webHookRequest (required) - * @return ApiResponse<WebhookModel> + * @param webHookRequestModel (required) + * @return ApiResponse<WebhookResponseModel> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -202,9 +202,9 @@ public WebhookModel createWebhook(UUID configId, UUID environmentId, WebHookRequ
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, WebHookRequestModel webHookRequestModel) throws ApiException { + okhttp3.Call localVarCall = createWebhookValidateBeforeCall(configId, environmentId, webHookRequestModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -213,7 +213,7 @@ public ApiResponse createWebhookWithHttpInfo(UUID configId, UUID e * 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 webHookRequestModel (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -226,10 +226,10 @@ public ApiResponse createWebhookWithHttpInfo(UUID configId, UUID e 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 { + public okhttp3.Call createWebhookAsync(UUID configId, UUID environmentId, WebHookRequestModel webHookRequestModel, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createWebhookValidateBeforeCall(configId, environmentId, webHookRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = createWebhookValidateBeforeCall(configId, environmentId, webHookRequestModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -438,7 +438,7 @@ private okhttp3.Call getWebhookValidateBeforeCall(Integer webhookId, final ApiCa * Get Webhook * This endpoint returns the metadata of a Webhook identified by the `webhookId`. * @param webhookId The identifier of the Webhook. (required) - * @return WebhookModel + * @return WebhookResponseModel * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -449,8 +449,8 @@ private okhttp3.Call getWebhookValidateBeforeCall(Integer webhookId, final ApiCa
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); + public WebhookResponseModel getWebhook(Integer webhookId) throws ApiException { + ApiResponse localVarResp = getWebhookWithHttpInfo(webhookId); return localVarResp.getData(); } @@ -458,7 +458,7 @@ public WebhookModel getWebhook(Integer webhookId) throws ApiException { * 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> + * @return ApiResponse<WebhookResponseModel> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -469,9 +469,9 @@ public WebhookModel getWebhook(Integer webhookId) throws ApiException {
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ - public ApiResponse getWebhookWithHttpInfo(Integer webhookId) throws ApiException { + 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); } @@ -491,10 +491,10 @@ public ApiResponse getWebhookWithHttpInfo(Integer webhookId) throw 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; } @@ -706,7 +706,7 @@ private okhttp3.Call getWebhooksValidateBeforeCall(UUID productId, final ApiCall * 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> + * @return List<WebhookResponseModel> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -715,8 +715,8 @@ private okhttp3.Call getWebhooksValidateBeforeCall(UUID productId, final ApiCall
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); + public List getWebhooks(UUID productId) throws ApiException { + ApiResponse> localVarResp = getWebhooksWithHttpInfo(productId); return localVarResp.getData(); } @@ -724,7 +724,7 @@ 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. * @param productId The identifier of the Product. (required) - * @return ApiResponse<List<WebhookModel>> + * @return ApiResponse<List<WebhookResponseModel>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -733,9 +733,9 @@ public List getWebhooks(UUID productId) throws ApiException {
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); } @@ -753,17 +753,17 @@ public ApiResponse> getWebhooksWithHttpInfo(UUID productId) t 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 webHookRequestModel (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -776,7 +776,7 @@ public okhttp3.Call getWebhooksAsync(UUID productId, final ApiCallback 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, WebHookRequestModel webHookRequestModel, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -790,7 +790,7 @@ public okhttp3.Call replaceWebhookCall(Integer webhookId, WebHookRequest webHook basePath = null; } - Object localVarPostBody = webHookRequest; + Object localVarPostBody = webHookRequestModel; // create path and map variables String localVarPath = "/v1/webhooks/{webhookId}" @@ -825,18 +825,18 @@ public okhttp3.Call replaceWebhookCall(Integer webhookId, WebHookRequest webHook } @SuppressWarnings("rawtypes") - private okhttp3.Call replaceWebhookValidateBeforeCall(Integer webhookId, WebHookRequest webHookRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call replaceWebhookValidateBeforeCall(Integer webhookId, WebHookRequestModel webHookRequestModel, final ApiCallback _callback) throws ApiException { // verify the required parameter 'webhookId' is set if (webhookId == null) { throw new ApiException("Missing the required parameter 'webhookId' when calling replaceWebhook(Async)"); } - // verify the required parameter 'webHookRequest' is set - if (webHookRequest == null) { - throw new ApiException("Missing the required parameter 'webHookRequest' when calling replaceWebhook(Async)"); + // verify the required parameter 'webHookRequestModel' is set + if (webHookRequestModel == null) { + throw new ApiException("Missing the required parameter 'webHookRequestModel' when calling replaceWebhook(Async)"); } - return replaceWebhookCall(webhookId, webHookRequest, _callback); + return replaceWebhookCall(webhookId, webHookRequestModel, _callback); } @@ -844,8 +844,8 @@ private okhttp3.Call replaceWebhookValidateBeforeCall(Integer webhookId, WebHook * Replace Webhook * This endpoint replaces the whole value of a Webhook identified by the `webhookId` parameter. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. * @param webhookId The identifier of the Webhook. (required) - * @param webHookRequest (required) - * @return WebhookModel + * @param webHookRequestModel (required) + * @return WebhookResponseModel * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -856,8 +856,8 @@ private okhttp3.Call replaceWebhookValidateBeforeCall(Integer webhookId, WebHook
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 WebhookResponseModel replaceWebhook(Integer webhookId, WebHookRequestModel webHookRequestModel) throws ApiException { + ApiResponse localVarResp = replaceWebhookWithHttpInfo(webhookId, webHookRequestModel); return localVarResp.getData(); } @@ -865,8 +865,8 @@ public WebhookModel replaceWebhook(Integer webhookId, WebHookRequest webHookRequ * Replace Webhook * This endpoint replaces the whole value of a Webhook identified by the `webhookId` parameter. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. * @param webhookId The identifier of the Webhook. (required) - * @param webHookRequest (required) - * @return ApiResponse<WebhookModel> + * @param webHookRequestModel (required) + * @return ApiResponse<WebhookResponseModel> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -877,9 +877,9 @@ public WebhookModel replaceWebhook(Integer webhookId, WebHookRequest webHookRequ
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, WebHookRequestModel webHookRequestModel) throws ApiException { + okhttp3.Call localVarCall = replaceWebhookValidateBeforeCall(webhookId, webHookRequestModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -887,7 +887,7 @@ public ApiResponse replaceWebhookWithHttpInfo(Integer webhookId, W * 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 webHookRequestModel (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -900,10 +900,10 @@ public ApiResponse replaceWebhookWithHttpInfo(Integer webhookId, W 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 { + public okhttp3.Call replaceWebhookAsync(Integer webhookId, WebHookRequestModel webHookRequestModel, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = replaceWebhookValidateBeforeCall(webhookId, webHookRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = replaceWebhookValidateBeforeCall(webhookId, webHookRequestModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -992,7 +992,7 @@ private okhttp3.Call updateWebhookValidateBeforeCall(Integer webhookId, List @@ -1003,8 +1003,8 @@ private okhttp3.Call updateWebhookValidateBeforeCall(Integer webhookId, List 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 WebhookResponseModel updateWebhook(Integer webhookId, List jsonPatchOperation) throws ApiException { + ApiResponse localVarResp = updateWebhookWithHttpInfo(webhookId, jsonPatchOperation); return localVarResp.getData(); } @@ -1013,7 +1013,7 @@ public WebhookModel updateWebhook(Integer webhookId, List js * This endpoint updates a Webhook identified by the `webhookId` parameter with a collection of [JSON Patch](https://jsonpatch.com) operations. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. For example: We have the following resource. ```json { \"webhookId\": 6, \"url\": \"https://example.com/hook\", \"httpMethod\": \"post\", \"content\": \"null\", \"webHookHeaders\": [] } ``` If we send an update request body as below (it changes the `content` field and adds a new HTTP header): ```json [ { \"op\": \"replace\", \"path\": \"/content\", \"value\": \"Some webhook content.\" }, { \"op\": \"add\", \"path\": \"/webHookHeaders/-\", \"value\": { \"key\": \"X-Custom-Header\", \"value\": \"Custom header value\" } } ] ``` Only the `content` and `webHookHeaders` are updated and all the other attributes remain unchanged. So we get a response like this: ```json { \"webhookId\": 6, \"url\": \"https://example.com/hook\", \"httpMethod\": \"post\", \"content\": \"Some webhook content.\", \"webHookHeaders\": [ { \"key\": \"X-Custom-Header\", \"value\": \"Custom header value\", \"isSecure\": false } ] } ``` * @param webhookId The identifier of the Webhook. (required) * @param jsonPatchOperation (required) - * @return ApiResponse<WebhookModel> + * @return ApiResponse<WebhookResponseModel> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1024,9 +1024,9 @@ public WebhookModel updateWebhook(Integer webhookId, List js
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ - public ApiResponse updateWebhookWithHttpInfo(Integer webhookId, List jsonPatchOperation) throws ApiException { + public ApiResponse updateWebhookWithHttpInfo(Integer webhookId, List jsonPatchOperation) throws ApiException { okhttp3.Call localVarCall = updateWebhookValidateBeforeCall(webhookId, jsonPatchOperation, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1047,10 +1047,10 @@ public ApiResponse updateWebhookWithHttpInfo(Integer webhookId, Li 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 { + 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(); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/configcat/publicapi/java/client/api/ZombieStaleFlagsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/ZombieStaleFlagsApi.java new file mode 100644 index 0000000..18d02cd --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/ZombieStaleFlagsApi.java @@ -0,0 +1,253 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.StaleFlagProductModel; +import com.configcat.publicapi.java.client.model.StaleFlagReminderScope; +import com.configcat.publicapi.java.client.model.StaleFlagStaleInEnvironmentsType; +import java.util.UUID; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ZombieStaleFlagsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ZombieStaleFlagsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ZombieStaleFlagsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getStaleflags + * @param productId The identifier of the Product. (required) + * @param scope The scope of the report. (optional) + * @param staleFlagAgeDays The inactivity in days after a feature flag should be considered stale. (optional) + * @param staleFlagStaleInEnvironmentsType Consider a feature flag as stale if the feature flag is stale in all/any of the environments. (optional) + * @param ignoredEnvironmentIds Ignore environment identifiers from the report. (optional) + * @param ignoredTagIds Ignore feature flags from the report based on their tag identifiers. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getStaleflagsCall(UUID productId, StaleFlagReminderScope scope, Integer staleFlagAgeDays, StaleFlagStaleInEnvironmentsType staleFlagStaleInEnvironmentsType, List ignoredEnvironmentIds, List ignoredTagIds, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/staleflags" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (scope != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("scope", scope)); + } + + if (staleFlagAgeDays != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("staleFlagAgeDays", staleFlagAgeDays)); + } + + if (staleFlagStaleInEnvironmentsType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("staleFlagStaleInEnvironmentsType", staleFlagStaleInEnvironmentsType)); + } + + if (ignoredEnvironmentIds != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "ignoredEnvironmentIds", ignoredEnvironmentIds)); + } + + if (ignoredTagIds != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "ignoredTagIds", ignoredTagIds)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getStaleflagsValidateBeforeCall(UUID productId, StaleFlagReminderScope scope, Integer staleFlagAgeDays, StaleFlagStaleInEnvironmentsType staleFlagStaleInEnvironmentsType, List ignoredEnvironmentIds, List ignoredTagIds, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling getStaleflags(Async)"); + } + + return getStaleflagsCall(productId, scope, staleFlagAgeDays, staleFlagStaleInEnvironmentsType, ignoredEnvironmentIds, ignoredTagIds, _callback); + + } + + /** + * List Zombie (stale) flags for Product + * This endpoint returns the list of Zombie (stale) flags for a given Product and the result can be optionally filtered by various parameters. + * @param productId The identifier of the Product. (required) + * @param scope The scope of the report. (optional) + * @param staleFlagAgeDays The inactivity in days after a feature flag should be considered stale. (optional) + * @param staleFlagStaleInEnvironmentsType Consider a feature flag as stale if the feature flag is stale in all/any of the environments. (optional) + * @param ignoredEnvironmentIds Ignore environment identifiers from the report. (optional) + * @param ignoredTagIds Ignore feature flags from the report based on their tag identifiers. (optional) + * @return StaleFlagProductModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public StaleFlagProductModel getStaleflags(UUID productId, StaleFlagReminderScope scope, Integer staleFlagAgeDays, StaleFlagStaleInEnvironmentsType staleFlagStaleInEnvironmentsType, List ignoredEnvironmentIds, List ignoredTagIds) throws ApiException { + ApiResponse localVarResp = getStaleflagsWithHttpInfo(productId, scope, staleFlagAgeDays, staleFlagStaleInEnvironmentsType, ignoredEnvironmentIds, ignoredTagIds); + return localVarResp.getData(); + } + + /** + * List Zombie (stale) flags for Product + * This endpoint returns the list of Zombie (stale) flags for a given Product and the result can be optionally filtered by various parameters. + * @param productId The identifier of the Product. (required) + * @param scope The scope of the report. (optional) + * @param staleFlagAgeDays The inactivity in days after a feature flag should be considered stale. (optional) + * @param staleFlagStaleInEnvironmentsType Consider a feature flag as stale if the feature flag is stale in all/any of the environments. (optional) + * @param ignoredEnvironmentIds Ignore environment identifiers from the report. (optional) + * @param ignoredTagIds Ignore feature flags from the report based on their tag identifiers. (optional) + * @return ApiResponse<StaleFlagProductModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getStaleflagsWithHttpInfo(UUID productId, StaleFlagReminderScope scope, Integer staleFlagAgeDays, StaleFlagStaleInEnvironmentsType staleFlagStaleInEnvironmentsType, List ignoredEnvironmentIds, List ignoredTagIds) throws ApiException { + okhttp3.Call localVarCall = getStaleflagsValidateBeforeCall(productId, scope, staleFlagAgeDays, staleFlagStaleInEnvironmentsType, ignoredEnvironmentIds, ignoredTagIds, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Zombie (stale) flags for Product (asynchronously) + * This endpoint returns the list of Zombie (stale) flags for a given Product and the result can be optionally filtered by various parameters. + * @param productId The identifier of the Product. (required) + * @param scope The scope of the report. (optional) + * @param staleFlagAgeDays The inactivity in days after a feature flag should be considered stale. (optional) + * @param staleFlagStaleInEnvironmentsType Consider a feature flag as stale if the feature flag is stale in all/any of the environments. (optional) + * @param ignoredEnvironmentIds Ignore environment identifiers from the report. (optional) + * @param ignoredTagIds Ignore feature flags from the report based on their tag identifiers. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getStaleflagsAsync(UUID productId, StaleFlagReminderScope scope, Integer staleFlagAgeDays, StaleFlagStaleInEnvironmentsType staleFlagStaleInEnvironmentsType, List ignoredEnvironmentIds, List ignoredTagIds, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getStaleflagsValidateBeforeCall(productId, scope, staleFlagAgeDays, staleFlagStaleInEnvironmentsType, ignoredEnvironmentIds, ignoredTagIds, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/auth/ApiKeyAuth.java b/src/main/java/com/configcat/publicapi/java/client/auth/ApiKeyAuth.java index 36a056f..cc2e81e 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 @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; 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 209d7ce..d53dd00 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 @@ -22,7 +22,7 @@ import java.util.Optional; import java.util.function.Supplier; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class HttpBearerAuth implements Authentication { private final String scheme; private Supplier tokenSupplier; 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 805cb9b..a023d85 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 @@ -21,7 +21,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object 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 6375f81..1bca446 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 @@ -50,7 +50,7 @@ /** * AddOrUpdateIntegrationLinkModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class AddOrUpdateIntegrationLinkModel { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @SerializedName(SERIALIZED_NAME_DESCRIPTION) 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 e64df47..ba19e07 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 @@ -50,7 +50,7 @@ /** * AddOrUpdateJiraIntegrationLinkModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class AddOrUpdateJiraIntegrationLinkModel { public static final String SERIALIZED_NAME_JIRA_JWT_TOKEN = "jiraJwtToken"; @SerializedName(SERIALIZED_NAME_JIRA_JWT_TOKEN) 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 a16fdc4..1afebb5 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 @@ -24,7 +24,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -53,7 +52,7 @@ /** * AuditLogItemModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class AuditLogItemModel { public static final String SERIALIZED_NAME_AUDIT_LOG_ID = "auditLogId"; @SerializedName(SERIALIZED_NAME_AUDIT_LOG_ID) @@ -115,7 +114,7 @@ public AuditLogItemModel auditLogId(Long auditLogId) { * Get auditLogId * @return auditLogId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Long getAuditLogId() { return auditLogId; } @@ -134,7 +133,7 @@ public AuditLogItemModel auditLogDateTime(OffsetDateTime auditLogDateTime) { * Get auditLogDateTime * @return auditLogDateTime */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public OffsetDateTime getAuditLogDateTime() { return auditLogDateTime; } @@ -153,7 +152,7 @@ public AuditLogItemModel auditLogTypeEnum(AuditLogType auditLogTypeEnum) { * Get auditLogTypeEnum * @return auditLogTypeEnum */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public AuditLogType getAuditLogTypeEnum() { return auditLogTypeEnum; } @@ -191,7 +190,7 @@ public AuditLogItemModel truncated(Boolean truncated) { * Get truncated * @return truncated */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getTruncated() { return truncated; } @@ -403,22 +402,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, auditLogItemModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(auditLogId, auditLogDateTime, auditLogTypeEnum, changeSetId, truncated, auditLogType, userEmail, userName, where, why, actionTarget, details, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -473,6 +461,18 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("auditLogId"); + openapiRequiredFields.add("auditLogDateTime"); + openapiRequiredFields.add("auditLogTypeEnum"); + openapiRequiredFields.add("changeSetId"); + openapiRequiredFields.add("truncated"); + openapiRequiredFields.add("auditLogType"); + openapiRequiredFields.add("userEmail"); + openapiRequiredFields.add("userName"); + openapiRequiredFields.add("where"); + openapiRequiredFields.add("why"); + openapiRequiredFields.add("actionTarget"); + openapiRequiredFields.add("details"); } /** @@ -487,11 +487,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in AuditLogItemModel is not found in the empty JSON string", AuditLogItemModel.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `auditLogTypeEnum` - if (jsonObj.get("auditLogTypeEnum") != null && !jsonObj.get("auditLogTypeEnum").isJsonNull()) { - AuditLogType.validateJsonElement(jsonObj.get("auditLogTypeEnum")); + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AuditLogItemModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `auditLogTypeEnum` + AuditLogType.validateJsonElement(jsonObj.get("auditLogTypeEnum")); if ((jsonObj.get("changeSetId") != null && !jsonObj.get("changeSetId").isJsonNull()) && !jsonObj.get("changeSetId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `changeSetId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("changeSetId").toString())); } 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 index d3c7a56..0ca1030 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/AuditLogType.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/AuditLogType.java @@ -205,7 +205,13 @@ public enum AuditLogType { AWS_CONNECTED("awsConnected"), - AWS_DISCONNECTED("awsDisconnected"); + AWS_DISCONNECTED("awsDisconnected"), + + USER_ENABLED("userEnabled"), + + SYNC_USER_DELETED("syncUserDeleted"), + + SYNC_GROUP_DELETED("syncGroupDeleted"); private String 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 1164cbf..2ac1b13 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 @@ -14,7 +14,7 @@ package com.configcat.publicapi.java.client.model; import java.util.Objects; -import com.configcat.publicapi.java.client.model.ReferenceLines; +import com.configcat.publicapi.java.client.model.ReferenceLinesModel; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -26,7 +26,6 @@ import java.util.Arrays; import java.util.List; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -55,7 +54,7 @@ /** * CodeReferenceModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class CodeReferenceModel { public static final String SERIALIZED_NAME_BRANCH = "branch"; @SerializedName(SERIALIZED_NAME_BRANCH) @@ -63,7 +62,7 @@ public class CodeReferenceModel { public static final String SERIALIZED_NAME_REFERENCES = "references"; @SerializedName(SERIALIZED_NAME_REFERENCES) - private List references; + private List references; public static final String SERIALIZED_NAME_COMMIT_URL = "commitUrl"; @SerializedName(SERIALIZED_NAME_COMMIT_URL) @@ -111,12 +110,12 @@ public void setBranch(String branch) { } - public CodeReferenceModel references(List references) { + public CodeReferenceModel references(List references) { this.references = references; return this; } - public CodeReferenceModel addReferencesItem(ReferenceLines referencesItem) { + public CodeReferenceModel addReferencesItem(ReferenceLinesModel referencesItem) { if (this.references == null) { this.references = new ArrayList<>(); } @@ -129,11 +128,11 @@ public CodeReferenceModel addReferencesItem(ReferenceLines referencesItem) { * @return references */ @javax.annotation.Nullable - public List getReferences() { + public List getReferences() { return references; } - public void setReferences(List references) { + public void setReferences(List references) { this.references = references; } @@ -185,7 +184,7 @@ public CodeReferenceModel syncedAt(OffsetDateTime syncedAt) { * The date and time when the reference report was uploaded. * @return syncedAt */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public OffsetDateTime getSyncedAt() { return syncedAt; } @@ -223,7 +222,7 @@ public CodeReferenceModel codeReferenceId(UUID codeReferenceId) { * The identifier of the reference report. * @return codeReferenceId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getCodeReferenceId() { return codeReferenceId; } @@ -317,22 +316,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, codeReferenceModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(branch, references, commitUrl, commitHash, syncedAt, repository, codeReferenceId, uploader, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -379,6 +367,14 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("branch"); + openapiRequiredFields.add("references"); + openapiRequiredFields.add("commitUrl"); + openapiRequiredFields.add("commitHash"); + openapiRequiredFields.add("syncedAt"); + openapiRequiredFields.add("repository"); + openapiRequiredFields.add("codeReferenceId"); + openapiRequiredFields.add("uploader"); } /** @@ -393,24 +389,27 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in CodeReferenceModel is not found in the empty JSON string", CodeReferenceModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CodeReferenceModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("branch") != null && !jsonObj.get("branch").isJsonNull()) && !jsonObj.get("branch").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `branch` to be a primitive type in the JSON string but got `%s`", jsonObj.get("branch").toString())); } - 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)); - }; - } + // ensure the json data is an array + if (!jsonObj.get("references").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `references` to be an array in the JSON string but got `%s`", jsonObj.get("references").toString())); } + + JsonArray jsonArrayreferences = jsonObj.getAsJsonArray("references"); + // validate the required field `references` (array) + for (int i = 0; i < jsonArrayreferences.size(); i++) { + ReferenceLinesModel.validateJsonElement(jsonArrayreferences.get(i)); + }; if ((jsonObj.get("commitUrl") != null && !jsonObj.get("commitUrl").isJsonNull()) && !jsonObj.get("commitUrl").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `commitUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitUrl").toString())); } @@ -420,7 +419,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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()) { + if (!jsonObj.get("codeReferenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `codeReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("codeReferenceId").toString())); } if ((jsonObj.get("uploader") != null && !jsonObj.get("uploader").isJsonNull()) && !jsonObj.get("uploader").isJsonPrimitive()) { 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 741c117..ebe8a6b 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 @@ -54,7 +54,7 @@ /** * CodeReferenceRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class CodeReferenceRequest { public static final String SERIALIZED_NAME_CONFIG_ID = "configId"; @SerializedName(SERIALIZED_NAME_CONFIG_ID) @@ -82,11 +82,11 @@ public class CodeReferenceRequest { public static final String SERIALIZED_NAME_ACTIVE_BRANCHES = "activeBranches"; @SerializedName(SERIALIZED_NAME_ACTIVE_BRANCHES) - private List activeBranches; + private List activeBranches = new ArrayList<>(); public static final String SERIALIZED_NAME_FLAG_REFERENCES = "flagReferences"; @SerializedName(SERIALIZED_NAME_FLAG_REFERENCES) - private List flagReferences; + private List flagReferences = new ArrayList<>(); public CodeReferenceRequest() { } 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 e217ed2..8bc98cf 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 @@ -50,7 +50,7 @@ /** * ComparisonValueListModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class ComparisonValueListModel { public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) 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 b62a0da..7482201 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 @@ -53,7 +53,7 @@ /** * The value that the user object's attribute is compared to. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class ComparisonValueModel { public static final String SERIALIZED_NAME_STRING_VALUE = "stringValue"; @SerializedName(SERIALIZED_NAME_STRING_VALUE) 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 513aa9c..00c11d4 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 @@ -52,7 +52,7 @@ /** * ConditionModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class ConditionModel { public static final String SERIALIZED_NAME_USER_CONDITION = "userCondition"; @SerializedName(SERIALIZED_NAME_USER_CONDITION) @@ -227,6 +227,9 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userCondition"); + openapiRequiredFields.add("segmentCondition"); + openapiRequiredFields.add("prerequisiteFlagCondition"); } /** @@ -241,19 +244,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in ConditionModel is not found in the empty JSON string", ConditionModel.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `userCondition` - if (jsonObj.get("userCondition") != null && !jsonObj.get("userCondition").isJsonNull()) { - UserConditionModel.validateJsonElement(jsonObj.get("userCondition")); - } - // validate the optional field `segmentCondition` - if (jsonObj.get("segmentCondition") != null && !jsonObj.get("segmentCondition").isJsonNull()) { - SegmentConditionModel.validateJsonElement(jsonObj.get("segmentCondition")); - } - // validate the optional field `prerequisiteFlagCondition` - if (jsonObj.get("prerequisiteFlagCondition") != null && !jsonObj.get("prerequisiteFlagCondition").isJsonNull()) { - PrerequisiteFlagConditionModel.validateJsonElement(jsonObj.get("prerequisiteFlagCondition")); + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConditionModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `userCondition` + UserConditionModel.validateJsonElement(jsonObj.get("userCondition")); + // validate the required field `segmentCondition` + SegmentConditionModel.validateJsonElement(jsonObj.get("segmentCondition")); + // validate the required field `prerequisiteFlagCondition` + PrerequisiteFlagConditionModel.validateJsonElement(jsonObj.get("prerequisiteFlagCondition")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 99038c5..8669153 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 @@ -24,7 +24,6 @@ import java.io.IOException; import java.util.Arrays; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -53,7 +52,7 @@ /** * Details of the Config. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class ConfigModel { public static final String SERIALIZED_NAME_PRODUCT = "product"; @SerializedName(SERIALIZED_NAME_PRODUCT) @@ -95,7 +94,7 @@ public ConfigModel product(ProductModel product) { * Get product * @return product */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public ProductModel getProduct() { return product; } @@ -114,7 +113,7 @@ public ConfigModel configId(UUID configId) { * Identifier of the Config. * @return configId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getConfigId() { return configId; } @@ -133,7 +132,7 @@ public ConfigModel name(String name) { * Name of the Config. * @return name */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getName() { return name; } @@ -171,7 +170,7 @@ public ConfigModel order(Integer order) { * The order of the Config represented on the ConfigCat Dashboard. * @return order */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Integer getOrder() { return order; } @@ -209,7 +208,7 @@ public ConfigModel evaluationVersion(EvaluationVersion evaluationVersion) { * Get evaluationVersion * @return evaluationVersion */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public EvaluationVersion getEvaluationVersion() { return evaluationVersion; } @@ -283,22 +282,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, configModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(product, configId, name, description, order, migratedConfigId, evaluationVersion, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -343,6 +331,13 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("product"); + openapiRequiredFields.add("configId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("order"); + openapiRequiredFields.add("migratedConfigId"); + openapiRequiredFields.add("evaluationVersion"); } /** @@ -357,15 +352,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigModel is not found in the empty JSON string", ConfigModel.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `product` - if (jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) { - ProductModel.validateJsonElement(jsonObj.get("product")); + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConfigModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } } - if ((jsonObj.get("configId") != null && !jsonObj.get("configId").isJsonNull()) && !jsonObj.get("configId").isJsonPrimitive()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `product` + ProductModel.validateJsonElement(jsonObj.get("product")); + if (!jsonObj.get("configId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `configId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configId").toString())); } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + 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()) { @@ -374,10 +374,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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")); - } + // validate the required field `evaluationVersion` + EvaluationVersion.validateJsonElement(jsonObj.get("evaluationVersion")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 677e3a1..c916ec6 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 @@ -30,7 +30,6 @@ import java.util.Arrays; import java.util.List; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -59,7 +58,7 @@ /** * ConfigSettingFormulaModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class ConfigSettingFormulaModel { public static final String SERIALIZED_NAME_LAST_VERSION_ID = "lastVersionId"; @SerializedName(SERIALIZED_NAME_LAST_VERSION_ID) @@ -71,7 +70,7 @@ public class ConfigSettingFormulaModel { public static final String SERIALIZED_NAME_TARGETING_RULES = "targetingRules"; @SerializedName(SERIALIZED_NAME_TARGETING_RULES) - private List targetingRules; + private List targetingRules = new ArrayList<>(); public static final String SERIALIZED_NAME_SETTING = "setting"; @SerializedName(SERIALIZED_NAME_SETTING) @@ -95,15 +94,15 @@ public class ConfigSettingFormulaModel { public static final String SERIALIZED_NAME_INTEGRATION_LINKS = "integrationLinks"; @SerializedName(SERIALIZED_NAME_INTEGRATION_LINKS) - private List integrationLinks; + private List integrationLinks = new ArrayList<>(); public static final String SERIALIZED_NAME_SETTING_TAGS = "settingTags"; @SerializedName(SERIALIZED_NAME_SETTING_TAGS) - private List settingTags; + private List settingTags = new ArrayList<>(); public static final String SERIALIZED_NAME_SETTING_IDS_WHERE_PREREQUISITE = "settingIdsWherePrerequisite"; @SerializedName(SERIALIZED_NAME_SETTING_IDS_WHERE_PREREQUISITE) - private List settingIdsWherePrerequisite; + private List settingIdsWherePrerequisite = new ArrayList<>(); public ConfigSettingFormulaModel() { } @@ -117,7 +116,7 @@ public ConfigSettingFormulaModel lastVersionId(UUID lastVersionId) { * Get lastVersionId * @return lastVersionId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getLastVersionId() { return lastVersionId; } @@ -136,7 +135,7 @@ public ConfigSettingFormulaModel defaultValue(ValueModel defaultValue) { * Get defaultValue * @return defaultValue */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public ValueModel getDefaultValue() { return defaultValue; } @@ -163,7 +162,7 @@ public ConfigSettingFormulaModel addTargetingRulesItem(TargetingRuleModel target * The targeting rules of the Feature Flag or Setting. * @return targetingRules */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getTargetingRules() { return targetingRules; } @@ -182,7 +181,7 @@ public ConfigSettingFormulaModel setting(SettingDataModel setting) { * Get setting * @return setting */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public SettingDataModel getSetting() { return setting; } @@ -285,7 +284,7 @@ public ConfigSettingFormulaModel addIntegrationLinksItem(IntegrationLinkModel in * The integration links attached to the Feature Flag or Setting. * @return integrationLinks */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getIntegrationLinks() { return integrationLinks; } @@ -312,7 +311,7 @@ public ConfigSettingFormulaModel addSettingTagsItem(SettingTagModel settingTagsI * The tags attached to the Feature Flag or Setting. * @return settingTags */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getSettingTags() { return settingTags; } @@ -339,7 +338,7 @@ public ConfigSettingFormulaModel addSettingIdsWherePrerequisiteItem(Integer sett * List of Feature Flag and Setting IDs where the actual Feature Flag or Setting is prerequisite. * @return settingIdsWherePrerequisite */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getSettingIdsWherePrerequisite() { return settingIdsWherePrerequisite; } @@ -417,22 +416,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, configSettingFormulaModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(lastVersionId, defaultValue, targetingRules, setting, updatedAt, percentageEvaluationAttribute, lastUpdaterUserEmail, lastUpdaterUserFullName, integrationLinks, settingTags, settingIdsWherePrerequisite, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -485,6 +473,17 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("lastVersionId"); + openapiRequiredFields.add("defaultValue"); + openapiRequiredFields.add("targetingRules"); + openapiRequiredFields.add("setting"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("percentageEvaluationAttribute"); + openapiRequiredFields.add("lastUpdaterUserEmail"); + openapiRequiredFields.add("lastUpdaterUserFullName"); + openapiRequiredFields.add("integrationLinks"); + openapiRequiredFields.add("settingTags"); + openapiRequiredFields.add("settingIdsWherePrerequisite"); } /** @@ -499,32 +498,31 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigSettingFormulaModel is not found in the empty JSON string", ConfigSettingFormulaModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConfigSettingFormulaModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("lastVersionId") != null && !jsonObj.get("lastVersionId").isJsonNull()) && !jsonObj.get("lastVersionId").isJsonPrimitive()) { + if (!jsonObj.get("lastVersionId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `lastVersionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastVersionId").toString())); } - // validate the 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")); + // validate the required field `defaultValue` + ValueModel.validateJsonElement(jsonObj.get("defaultValue")); + // ensure the json data is an array + if (!jsonObj.get("targetingRules").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `targetingRules` to be an array in the JSON string but got `%s`", jsonObj.get("targetingRules").toString())); } + + JsonArray jsonArraytargetingRules = jsonObj.getAsJsonArray("targetingRules"); + // validate the required field `targetingRules` (array) + for (int i = 0; i < jsonArraytargetingRules.size(); i++) { + TargetingRuleModel.validateJsonElement(jsonArraytargetingRules.get(i)); + }; + // validate the required field `setting` + SettingDataModel.validateJsonElement(jsonObj.get("setting")); if ((jsonObj.get("percentageEvaluationAttribute") != null && !jsonObj.get("percentageEvaluationAttribute").isJsonNull()) && !jsonObj.get("percentageEvaluationAttribute").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `percentageEvaluationAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("percentageEvaluationAttribute").toString())); } @@ -534,36 +532,30 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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)); - }; - } + // 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())); } - 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)); - }; - } + + JsonArray jsonArrayintegrationLinks = jsonObj.getAsJsonArray("integrationLinks"); + // validate the required field `integrationLinks` (array) + for (int i = 0; i < jsonArrayintegrationLinks.size(); i++) { + IntegrationLinkModel.validateJsonElement(jsonArrayintegrationLinks.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("settingTags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settingTags` to be an array in the JSON string but got `%s`", jsonObj.get("settingTags").toString())); } - // ensure the optional json data is an array if present - if (jsonObj.get("settingIdsWherePrerequisite") != null && !jsonObj.get("settingIdsWherePrerequisite").isJsonNull() && !jsonObj.get("settingIdsWherePrerequisite").isJsonArray()) { + + JsonArray jsonArraysettingTags = jsonObj.getAsJsonArray("settingTags"); + // validate the required field `settingTags` (array) + for (int i = 0; i < jsonArraysettingTags.size(); i++) { + SettingTagModel.validateJsonElement(jsonArraysettingTags.get(i)); + }; + // ensure the required json array is present + if (jsonObj.get("settingIdsWherePrerequisite") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("settingIdsWherePrerequisite").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `settingIdsWherePrerequisite` to be an array in the JSON string but got `%s`", jsonObj.get("settingIdsWherePrerequisite").toString())); } } 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 7518101..149991c 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 @@ -27,7 +27,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -56,7 +55,7 @@ /** * ConfigSettingFormulasModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class ConfigSettingFormulasModel { public static final String SERIALIZED_NAME_CONFIG = "config"; @SerializedName(SERIALIZED_NAME_CONFIG) @@ -72,7 +71,7 @@ public class ConfigSettingFormulasModel { public static final String SERIALIZED_NAME_SETTING_FORMULAS = "settingFormulas"; @SerializedName(SERIALIZED_NAME_SETTING_FORMULAS) - private List settingFormulas; + private List settingFormulas = new ArrayList<>(); public static final String SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS = "featureFlagLimitations"; @SerializedName(SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS) @@ -90,7 +89,7 @@ public ConfigSettingFormulasModel config(ConfigModel config) { * Get config * @return config */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public ConfigModel getConfig() { return config; } @@ -109,7 +108,7 @@ public ConfigSettingFormulasModel environment(EnvironmentModel environment) { * Get environment * @return environment */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public EnvironmentModel getEnvironment() { return environment; } @@ -128,7 +127,7 @@ public ConfigSettingFormulasModel readOnly(Boolean readOnly) { * Get readOnly * @return readOnly */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getReadOnly() { return readOnly; } @@ -155,7 +154,7 @@ public ConfigSettingFormulasModel addSettingFormulasItem(ConfigSettingFormulaMod * Evaluation descriptors of each updated Feature Flag and Setting. * @return settingFormulas */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getSettingFormulas() { return settingFormulas; } @@ -174,7 +173,7 @@ public ConfigSettingFormulasModel featureFlagLimitations(FeatureFlagLimitations * Get featureFlagLimitations * @return featureFlagLimitations */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public FeatureFlagLimitations getFeatureFlagLimitations() { return featureFlagLimitations; } @@ -246,22 +245,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, configSettingFormulasModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(config, environment, readOnly, settingFormulas, featureFlagLimitations, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -302,6 +290,11 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("config"); + openapiRequiredFields.add("environment"); + openapiRequiredFields.add("readOnly"); + openapiRequiredFields.add("settingFormulas"); + openapiRequiredFields.add("featureFlagLimitations"); } /** @@ -316,33 +309,30 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigSettingFormulasModel is not found in the empty JSON string", ConfigSettingFormulasModel.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `config` - if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { - ConfigModel.validateJsonElement(jsonObj.get("config")); - } - // validate the optional field `environment` - if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonNull()) { - EnvironmentModel.validateJsonElement(jsonObj.get("environment")); - } - if (jsonObj.get("settingFormulas") != null && !jsonObj.get("settingFormulas").isJsonNull()) { - JsonArray jsonArraysettingFormulas = jsonObj.getAsJsonArray("settingFormulas"); - if (jsonArraysettingFormulas != null) { - // ensure the json data is an array - if (!jsonObj.get("settingFormulas").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `settingFormulas` to be an array in the JSON string but got `%s`", jsonObj.get("settingFormulas").toString())); - } - - // validate the optional field `settingFormulas` (array) - for (int i = 0; i < jsonArraysettingFormulas.size(); i++) { - ConfigSettingFormulaModel.validateJsonElement(jsonArraysettingFormulas.get(i)); - }; + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConfigSettingFormulasModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } - // validate the optional field `featureFlagLimitations` - if (jsonObj.get("featureFlagLimitations") != null && !jsonObj.get("featureFlagLimitations").isJsonNull()) { - FeatureFlagLimitations.validateJsonElement(jsonObj.get("featureFlagLimitations")); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `config` + ConfigModel.validateJsonElement(jsonObj.get("config")); + // validate the required field `environment` + EnvironmentModel.validateJsonElement(jsonObj.get("environment")); + // ensure the json data is an array + if (!jsonObj.get("settingFormulas").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settingFormulas` to be an array in the JSON string but got `%s`", jsonObj.get("settingFormulas").toString())); } + + JsonArray jsonArraysettingFormulas = jsonObj.getAsJsonArray("settingFormulas"); + // validate the required field `settingFormulas` (array) + for (int i = 0; i < jsonArraysettingFormulas.size(); i++) { + ConfigSettingFormulaModel.validateJsonElement(jsonArraysettingFormulas.get(i)); + }; + // validate the required field `featureFlagLimitations` + FeatureFlagLimitations.validateJsonElement(jsonObj.get("featureFlagLimitations")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 0e05b8c..9dc292a 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 @@ -19,6 +19,7 @@ import com.configcat.publicapi.java.client.model.RolloutRuleModel; import com.configcat.publicapi.java.client.model.SettingDataModel; import com.configcat.publicapi.java.client.model.SettingTagModel; +import com.configcat.publicapi.java.client.model.SettingValueType; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -29,7 +30,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -58,20 +58,8 @@ /** * ConfigSettingValueModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class ConfigSettingValueModel { - public static final String SERIALIZED_NAME_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; @@ -90,88 +78,27 @@ public class ConfigSettingValueModel { public static final String SERIALIZED_NAME_INTEGRATION_LINKS = "integrationLinks"; @SerializedName(SERIALIZED_NAME_INTEGRATION_LINKS) - private List integrationLinks; + private List integrationLinks = new ArrayList<>(); 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; - } + private List settingTags = new ArrayList<>(); + public static final String SERIALIZED_NAME_ROLLOUT_RULES = "rolloutRules"; + @SerializedName(SERIALIZED_NAME_ROLLOUT_RULES) + private List rolloutRules = new ArrayList<>(); - public ConfigSettingValueModel value(Object value) { - this.value = value; - return this; - } + public static final String SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS = "rolloutPercentageItems"; + @SerializedName(SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS) + private List rolloutPercentageItems = new ArrayList<>(); - /** - * The value to serve. It must respect the setting type. - * @return value - */ - @javax.annotation.Nullable - public Object getValue() { - return value; - } + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private SettingValueType value; - public void setValue(Object value) { - this.value = value; + public ConfigSettingValueModel() { } - public ConfigSettingValueModel setting(SettingDataModel setting) { this.setting = setting; return this; @@ -181,7 +108,7 @@ public ConfigSettingValueModel setting(SettingDataModel setting) { * Get setting * @return setting */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public SettingDataModel getSetting() { return setting; } @@ -265,7 +192,7 @@ public ConfigSettingValueModel addIntegrationLinksItem(IntegrationLinkModel inte * The integration links attached to the Feature Flag or Setting. * @return integrationLinks */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getIntegrationLinks() { return integrationLinks; } @@ -292,7 +219,7 @@ public ConfigSettingValueModel addSettingTagsItem(SettingTagModel settingTagsIte * The tags attached to the Feature Flag or Setting. * @return settingTags */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getSettingTags() { return settingTags; } @@ -301,6 +228,79 @@ public void setSettingTags(List settingTags) { this.settingTags = settingTags; } + + public ConfigSettingValueModel rolloutRules(List rolloutRules) { + this.rolloutRules = rolloutRules; + return this; + } + + public ConfigSettingValueModel addRolloutRulesItem(RolloutRuleModel rolloutRulesItem) { + if (this.rolloutRules == null) { + this.rolloutRules = new ArrayList<>(); + } + this.rolloutRules.add(rolloutRulesItem); + return this; + } + + /** + * The targeting rule collection. + * @return rolloutRules + */ + @javax.annotation.Nonnull + public List getRolloutRules() { + return rolloutRules; + } + + public void setRolloutRules(List rolloutRules) { + this.rolloutRules = rolloutRules; + } + + + public ConfigSettingValueModel rolloutPercentageItems(List rolloutPercentageItems) { + this.rolloutPercentageItems = rolloutPercentageItems; + return this; + } + + public ConfigSettingValueModel addRolloutPercentageItemsItem(RolloutPercentageItemModel rolloutPercentageItemsItem) { + if (this.rolloutPercentageItems == null) { + this.rolloutPercentageItems = new ArrayList<>(); + } + this.rolloutPercentageItems.add(rolloutPercentageItemsItem); + return this; + } + + /** + * The percentage rule collection. + * @return rolloutPercentageItems + */ + @javax.annotation.Nonnull + public List getRolloutPercentageItems() { + return rolloutPercentageItems; + } + + public void setRolloutPercentageItems(List rolloutPercentageItems) { + this.rolloutPercentageItems = rolloutPercentageItems; + } + + + public ConfigSettingValueModel value(SettingValueType value) { + this.value = value; + return this; + } + + /** + * The value to serve. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. + * @return value + */ + @javax.annotation.Nonnull + public SettingValueType getValue() { + return value; + } + + public void setValue(SettingValueType value) { + this.value = value; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -356,47 +356,36 @@ public boolean equals(Object o) { 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) && + return Objects.equals(this.setting, configSettingValueModel.setting) && Objects.equals(this.updatedAt, configSettingValueModel.updatedAt) && Objects.equals(this.lastUpdaterUserEmail, configSettingValueModel.lastUpdaterUserEmail) && Objects.equals(this.lastUpdaterUserFullName, configSettingValueModel.lastUpdaterUserFullName) && Objects.equals(this.integrationLinks, configSettingValueModel.integrationLinks) && - Objects.equals(this.settingTags, configSettingValueModel.settingTags)&& + Objects.equals(this.settingTags, configSettingValueModel.settingTags) && + Objects.equals(this.rolloutRules, configSettingValueModel.rolloutRules) && + Objects.equals(this.rolloutPercentageItems, configSettingValueModel.rolloutPercentageItems) && + Objects.equals(this.value, configSettingValueModel.value)&& Objects.equals(this.additionalProperties, configSettingValueModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { - return Objects.hash(rolloutRules, rolloutPercentageItems, value, setting, updatedAt, lastUpdaterUserEmail, lastUpdaterUserFullName, integrationLinks, settingTags, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + return Objects.hash(setting, updatedAt, lastUpdaterUserEmail, lastUpdaterUserFullName, integrationLinks, settingTags, rolloutRules, rolloutPercentageItems, value, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ConfigSettingValueModel {\n"); - sb.append(" 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(" rolloutRules: ").append(toIndentedString(rolloutRules)).append("\n"); + sb.append(" rolloutPercentageItems: ").append(toIndentedString(rolloutPercentageItems)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -420,18 +409,27 @@ private String toIndentedString(Object o) { 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("rolloutRules"); + openapiFields.add("rolloutPercentageItems"); + openapiFields.add("value"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("setting"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("lastUpdaterUserEmail"); + openapiRequiredFields.add("lastUpdaterUserFullName"); + openapiRequiredFields.add("integrationLinks"); + openapiRequiredFields.add("settingTags"); + openapiRequiredFields.add("rolloutRules"); + openapiRequiredFields.add("rolloutPercentageItems"); + openapiRequiredFields.add("value"); } /** @@ -446,73 +444,64 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigSettingValueModel is not found in the empty JSON string", ConfigSettingValueModel.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("rolloutRules") != null && !jsonObj.get("rolloutRules").isJsonNull()) { - JsonArray jsonArrayrolloutRules = jsonObj.getAsJsonArray("rolloutRules"); - if (jsonArrayrolloutRules != null) { - // ensure the json data is an array - if (!jsonObj.get("rolloutRules").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rolloutRules` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutRules").toString())); - } - - // validate the optional field `rolloutRules` (array) - for (int i = 0; i < jsonArrayrolloutRules.size(); i++) { - RolloutRuleModel.validateJsonElement(jsonArrayrolloutRules.get(i)); - }; - } - } - if (jsonObj.get("rolloutPercentageItems") != null && !jsonObj.get("rolloutPercentageItems").isJsonNull()) { - JsonArray jsonArrayrolloutPercentageItems = jsonObj.getAsJsonArray("rolloutPercentageItems"); - if (jsonArrayrolloutPercentageItems != null) { - // ensure the json data is an array - if (!jsonObj.get("rolloutPercentageItems").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rolloutPercentageItems` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutPercentageItems").toString())); - } - - // validate the optional field `rolloutPercentageItems` (array) - for (int i = 0; i < jsonArrayrolloutPercentageItems.size(); i++) { - RolloutPercentageItemModel.validateJsonElement(jsonArrayrolloutPercentageItems.get(i)); - }; + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConfigSettingValueModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } - // validate the optional field `setting` - if (jsonObj.get("setting") != null && !jsonObj.get("setting").isJsonNull()) { - SettingDataModel.validateJsonElement(jsonObj.get("setting")); - } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `setting` + SettingDataModel.validateJsonElement(jsonObj.get("setting")); if ((jsonObj.get("lastUpdaterUserEmail") != null && !jsonObj.get("lastUpdaterUserEmail").isJsonNull()) && !jsonObj.get("lastUpdaterUserEmail").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserEmail").toString())); } if ((jsonObj.get("lastUpdaterUserFullName") != null && !jsonObj.get("lastUpdaterUserFullName").isJsonNull()) && !jsonObj.get("lastUpdaterUserFullName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserFullName").toString())); } - 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)); - }; - } + // 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())); } - 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)); - }; - } + + JsonArray jsonArrayintegrationLinks = jsonObj.getAsJsonArray("integrationLinks"); + // validate the required field `integrationLinks` (array) + for (int i = 0; i < jsonArrayintegrationLinks.size(); i++) { + IntegrationLinkModel.validateJsonElement(jsonArrayintegrationLinks.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("settingTags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settingTags` to be an array in the JSON string but got `%s`", jsonObj.get("settingTags").toString())); } + + JsonArray jsonArraysettingTags = jsonObj.getAsJsonArray("settingTags"); + // validate the required field `settingTags` (array) + for (int i = 0; i < jsonArraysettingTags.size(); i++) { + SettingTagModel.validateJsonElement(jsonArraysettingTags.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("rolloutRules").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rolloutRules` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutRules").toString())); + } + + JsonArray jsonArrayrolloutRules = jsonObj.getAsJsonArray("rolloutRules"); + // validate the required field `rolloutRules` (array) + for (int i = 0; i < jsonArrayrolloutRules.size(); i++) { + RolloutRuleModel.validateJsonElement(jsonArrayrolloutRules.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("rolloutPercentageItems").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rolloutPercentageItems` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutPercentageItems").toString())); + } + + JsonArray jsonArrayrolloutPercentageItems = jsonObj.getAsJsonArray("rolloutPercentageItems"); + // validate the required field `rolloutPercentageItems` (array) + for (int i = 0; i < jsonArrayrolloutPercentageItems.size(); i++) { + RolloutPercentageItemModel.validateJsonElement(jsonArrayrolloutPercentageItems.get(i)); + }; + // validate the required field `value` + SettingValueType.validateJsonElement(jsonObj.get("value")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 62bee71..ee9ab73 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 @@ -27,7 +27,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -56,7 +55,7 @@ /** * ConfigSettingValuesModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class ConfigSettingValuesModel { public static final String SERIALIZED_NAME_CONFIG = "config"; @SerializedName(SERIALIZED_NAME_CONFIG) @@ -72,7 +71,7 @@ public class ConfigSettingValuesModel { public static final String SERIALIZED_NAME_SETTING_VALUES = "settingValues"; @SerializedName(SERIALIZED_NAME_SETTING_VALUES) - private List settingValues; + private List settingValues = new ArrayList<>(); public static final String SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS = "featureFlagLimitations"; @SerializedName(SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS) @@ -90,7 +89,7 @@ public ConfigSettingValuesModel config(ConfigModel config) { * Get config * @return config */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public ConfigModel getConfig() { return config; } @@ -109,7 +108,7 @@ public ConfigSettingValuesModel environment(EnvironmentModel environment) { * Get environment * @return environment */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public EnvironmentModel getEnvironment() { return environment; } @@ -128,7 +127,7 @@ public ConfigSettingValuesModel readOnly(Boolean readOnly) { * Get readOnly * @return readOnly */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getReadOnly() { return readOnly; } @@ -155,7 +154,7 @@ public ConfigSettingValuesModel addSettingValuesItem(ConfigSettingValueModel set * Get settingValues * @return settingValues */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getSettingValues() { return settingValues; } @@ -174,7 +173,7 @@ public ConfigSettingValuesModel featureFlagLimitations(FeatureFlagLimitations fe * Get featureFlagLimitations * @return featureFlagLimitations */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public FeatureFlagLimitations getFeatureFlagLimitations() { return featureFlagLimitations; } @@ -246,22 +245,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, configSettingValuesModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(config, environment, readOnly, settingValues, featureFlagLimitations, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -302,6 +290,11 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("config"); + openapiRequiredFields.add("environment"); + openapiRequiredFields.add("readOnly"); + openapiRequiredFields.add("settingValues"); + openapiRequiredFields.add("featureFlagLimitations"); } /** @@ -316,33 +309,30 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigSettingValuesModel is not found in the empty JSON string", ConfigSettingValuesModel.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `config` - if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { - ConfigModel.validateJsonElement(jsonObj.get("config")); - } - // validate the optional field `environment` - if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonNull()) { - EnvironmentModel.validateJsonElement(jsonObj.get("environment")); - } - if (jsonObj.get("settingValues") != null && !jsonObj.get("settingValues").isJsonNull()) { - JsonArray jsonArraysettingValues = jsonObj.getAsJsonArray("settingValues"); - if (jsonArraysettingValues != null) { - // ensure the json data is an array - if (!jsonObj.get("settingValues").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `settingValues` to be an array in the JSON string but got `%s`", jsonObj.get("settingValues").toString())); - } - - // validate the optional field `settingValues` (array) - for (int i = 0; i < jsonArraysettingValues.size(); i++) { - ConfigSettingValueModel.validateJsonElement(jsonArraysettingValues.get(i)); - }; + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConfigSettingValuesModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } - // validate the optional field `featureFlagLimitations` - if (jsonObj.get("featureFlagLimitations") != null && !jsonObj.get("featureFlagLimitations").isJsonNull()) { - FeatureFlagLimitations.validateJsonElement(jsonObj.get("featureFlagLimitations")); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `config` + ConfigModel.validateJsonElement(jsonObj.get("config")); + // validate the required field `environment` + EnvironmentModel.validateJsonElement(jsonObj.get("environment")); + // ensure the json data is an array + if (!jsonObj.get("settingValues").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settingValues` to be an array in the JSON string but got `%s`", jsonObj.get("settingValues").toString())); } + + JsonArray jsonArraysettingValues = jsonObj.getAsJsonArray("settingValues"); + // validate the required field `settingValues` (array) + for (int i = 0; i < jsonArraysettingValues.size(); i++) { + ConfigSettingValueModel.validateJsonElement(jsonArraysettingValues.get(i)); + }; + // validate the required field `featureFlagLimitations` + FeatureFlagLimitations.validateJsonElement(jsonObj.get("featureFlagLimitations")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 cfc9b53..f7369cd 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 @@ -49,7 +49,7 @@ /** * ConnectRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class ConnectRequest { public static final String SERIALIZED_NAME_CLIENT_KEY = "clientKey"; @SerializedName(SERIALIZED_NAME_CLIENT_KEY) 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 33ca65c..cb2799d 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 @@ -51,7 +51,7 @@ /** * CreateConfigRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class CreateConfigRequest { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -116,7 +116,7 @@ public CreateConfigRequest order(Integer order) { } /** - * The order of the Config represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. + * The order of the Config represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. * @return order */ @javax.annotation.Nullable 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 f2732bf..7489de8 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 @@ -50,7 +50,7 @@ /** * CreateEnvironmentModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class CreateEnvironmentModel { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -134,7 +134,7 @@ public CreateEnvironmentModel order(Integer order) { } /** - * The order of the Environment represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. + * The order of the Environment represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. * @return order */ @javax.annotation.Nullable 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 450a90e..52dc209 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 @@ -55,7 +55,7 @@ /** * CreateIntegrationModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class CreateIntegrationModel { public static final String SERIALIZED_NAME_INTEGRATION_TYPE = "integrationType"; @SerializedName(SERIALIZED_NAME_INTEGRATION_TYPE) 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 0a274ad..a21c779 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 @@ -51,7 +51,7 @@ /** * CreateOrUpdateEnvironmentAccessModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class CreateOrUpdateEnvironmentAccessModel { public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) 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 3a66263..723e7dc 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 @@ -55,7 +55,7 @@ /** * CreatePermissionGroupRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class CreatePermissionGroupRequest { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) 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 a1f899b..cc1a2d6 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 @@ -50,7 +50,7 @@ /** * CreateProductRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class CreateProductRequest { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -111,7 +111,7 @@ public CreateProductRequest order(Integer order) { } /** - * The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. + * The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. * @return order */ @javax.annotation.Nullable 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 384c2d0..6cba1a2 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 @@ -51,7 +51,7 @@ /** * CreateSegmentModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class CreateSegmentModel { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) 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 cd91990..aef5085 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 @@ -54,7 +54,7 @@ /** * CreateSettingInitialValues */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class CreateSettingInitialValues { public static final String SERIALIZED_NAME_HINT = "hint"; @SerializedName(SERIALIZED_NAME_HINT) @@ -84,6 +84,10 @@ public class CreateSettingInitialValues { @SerializedName(SERIALIZED_NAME_INITIAL_VALUES) private List initialValues; + public static final String SERIALIZED_NAME_SETTING_ID_TO_INIT_FROM = "settingIdToInitFrom"; + @SerializedName(SERIALIZED_NAME_SETTING_ID_TO_INIT_FROM) + private Integer settingIdToInitFrom; + public CreateSettingInitialValues() { } @@ -139,7 +143,7 @@ public CreateSettingInitialValues order(Integer order) { } /** - * The order of the Setting represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. + * The order of the Setting represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. * @return order */ @javax.annotation.Nullable @@ -223,7 +227,7 @@ public CreateSettingInitialValues addInitialValuesItem(InitialValue initialValue } /** - * Optional, initial value of the Feature Flag or Setting in the given Environments. + * Optional, initial value of the Feature Flag or Setting in the given Environments. Only one of the SettingIdToInitFrom or the InitialValues properties can be set. * @return initialValues */ @javax.annotation.Nullable @@ -235,6 +239,25 @@ public void setInitialValues(List initialValues) { this.initialValues = initialValues; } + + public CreateSettingInitialValues settingIdToInitFrom(Integer settingIdToInitFrom) { + this.settingIdToInitFrom = settingIdToInitFrom; + return this; + } + + /** + * Optional, the SettingId to initialize the values and tags of the Feature Flag or Setting from. Only can be set if you have at least ReadOnly access in all the Environments. Only one of the SettingIdToInitFrom or the InitialValues properties can be set. + * @return settingIdToInitFrom + */ + @javax.annotation.Nullable + public Integer getSettingIdToInitFrom() { + return settingIdToInitFrom; + } + + public void setSettingIdToInitFrom(Integer settingIdToInitFrom) { + this.settingIdToInitFrom = settingIdToInitFrom; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -296,7 +319,8 @@ public boolean equals(Object o) { Objects.equals(this.key, createSettingInitialValues.key) && Objects.equals(this.name, createSettingInitialValues.name) && Objects.equals(this.settingType, createSettingInitialValues.settingType) && - Objects.equals(this.initialValues, createSettingInitialValues.initialValues)&& + Objects.equals(this.initialValues, createSettingInitialValues.initialValues) && + Objects.equals(this.settingIdToInitFrom, createSettingInitialValues.settingIdToInitFrom)&& Objects.equals(this.additionalProperties, createSettingInitialValues.additionalProperties); } @@ -306,7 +330,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(hint, tags, order, key, name, settingType, initialValues, additionalProperties); + return Objects.hash(hint, tags, order, key, name, settingType, initialValues, settingIdToInitFrom, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -327,6 +351,7 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" settingType: ").append(toIndentedString(settingType)).append("\n"); sb.append(" initialValues: ").append(toIndentedString(initialValues)).append("\n"); + sb.append(" settingIdToInitFrom: ").append(toIndentedString(settingIdToInitFrom)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -357,6 +382,7 @@ private String toIndentedString(Object o) { openapiFields.add("name"); openapiFields.add("settingType"); openapiFields.add("initialValues"); + openapiFields.add("settingIdToInitFrom"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); 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 e616763..62040b7 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 @@ -50,7 +50,7 @@ /** * CreateTagModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class CreateTagModel { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) 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 736503b..3f07e51 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 @@ -49,7 +49,7 @@ /** * DeleteIntegrationLinkModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class DeleteIntegrationLinkModel { public static final String SERIALIZED_NAME_HAS_REMAINING_INTEGRATION_LINK = "hasRemainingIntegrationLink"; @SerializedName(SERIALIZED_NAME_HAS_REMAINING_INTEGRATION_LINK) @@ -67,7 +67,7 @@ public DeleteIntegrationLinkModel hasRemainingIntegrationLink(Boolean hasRemaini * Get hasRemainingIntegrationLink * @return hasRemainingIntegrationLink */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getHasRemainingIntegrationLink() { return hasRemainingIntegrationLink; } @@ -172,6 +172,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("hasRemainingIntegrationLink"); } /** @@ -186,6 +187,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteIntegrationLinkModel is not found in the empty JSON string", DeleteIntegrationLinkModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteIntegrationLinkModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); } 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 88ee18e..f937624 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 @@ -51,7 +51,7 @@ /** * DeleteRepositoryReportsRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class DeleteRepositoryReportsRequest { public static final String SERIALIZED_NAME_CONFIG_ID = "configId"; @SerializedName(SERIALIZED_NAME_CONFIG_ID) diff --git a/src/main/java/com/configcat/publicapi/java/client/model/DeletedSettingModel.java b/src/main/java/com/configcat/publicapi/java/client/model/DeletedSettingModel.java new file mode 100644 index 0000000..bccf6df --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/DeletedSettingModel.java @@ -0,0 +1,372 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.SettingType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * DeletedSettingModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class DeletedSettingModel { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_HINT = "hint"; + @SerializedName(SERIALIZED_NAME_HINT) + private String hint; + + public static final String SERIALIZED_NAME_SETTING_TYPE = "settingType"; + @SerializedName(SERIALIZED_NAME_SETTING_TYPE) + private SettingType settingType; + + public DeletedSettingModel() { + } + + public DeletedSettingModel( + String key, + String name, + String hint + ) { + this(); + this.key = key; + this.name = name; + this.hint = hint; + } + + /** + * Key of the Feature Flag or Setting. + * @return key + */ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + + /** + * Name of the Feature Flag or Setting. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + + /** + * Description of the Feature Flag or Setting. + * @return hint + */ + @javax.annotation.Nullable + public String getHint() { + return hint; + } + + + + public DeletedSettingModel settingType(SettingType settingType) { + this.settingType = settingType; + return this; + } + + /** + * Get settingType + * @return settingType + */ + @javax.annotation.Nonnull + public SettingType getSettingType() { + return settingType; + } + + public void setSettingType(SettingType settingType) { + this.settingType = settingType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DeletedSettingModel instance itself + */ + public DeletedSettingModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeletedSettingModel deletedSettingModel = (DeletedSettingModel) o; + return Objects.equals(this.key, deletedSettingModel.key) && + Objects.equals(this.name, deletedSettingModel.name) && + Objects.equals(this.hint, deletedSettingModel.hint) && + Objects.equals(this.settingType, deletedSettingModel.settingType)&& + Objects.equals(this.additionalProperties, deletedSettingModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(key, name, hint, settingType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeletedSettingModel {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); + sb.append(" settingType: ").append(toIndentedString(settingType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("name"); + openapiFields.add("hint"); + openapiFields.add("settingType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("hint"); + openapiRequiredFields.add("settingType"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeletedSettingModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DeletedSettingModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeletedSettingModel is not found in the empty JSON string", DeletedSettingModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeletedSettingModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("hint") != null && !jsonObj.get("hint").isJsonNull()) && !jsonObj.get("hint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); + } + // validate the required field `settingType` + SettingType.validateJsonElement(jsonObj.get("settingType")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeletedSettingModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeletedSettingModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeletedSettingModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeletedSettingModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DeletedSettingModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DeletedSettingModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeletedSettingModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeletedSettingModel + * @throws IOException if the JSON string is invalid with respect to DeletedSettingModel + */ + public static DeletedSettingModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeletedSettingModel.class); + } + + /** + * Convert an instance of DeletedSettingModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessModel.java b/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessModel.java index d0e4d1f..a1b8751 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 @@ -23,7 +23,6 @@ import java.io.IOException; import java.util.Arrays; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -52,7 +51,7 @@ /** * EnvironmentAccessModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class EnvironmentAccessModel { public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) @@ -94,7 +93,7 @@ public EnvironmentAccessModel environmentId(UUID environmentId) { * Identifier of the Environment. * @return environmentId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getEnvironmentId() { return environmentId; } @@ -170,7 +169,7 @@ public EnvironmentAccessModel order(Integer order) { * The order of the Environment represented on the ConfigCat Dashboard. * @return order */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Integer getOrder() { return order; } @@ -189,7 +188,7 @@ public EnvironmentAccessModel reasonRequired(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 + @javax.annotation.Nonnull public Boolean getReasonRequired() { return reasonRequired; } @@ -208,7 +207,7 @@ public EnvironmentAccessModel environmentAccessType(EnvironmentAccessType enviro * Get environmentAccessType * @return environmentAccessType */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public EnvironmentAccessType getEnvironmentAccessType() { return environmentAccessType; } @@ -282,22 +281,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, environmentAccessModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(environmentId, name, color, description, order, reasonRequired, environmentAccessType, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -342,6 +330,13 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("environmentId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("color"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("order"); + openapiRequiredFields.add("reasonRequired"); + openapiRequiredFields.add("environmentAccessType"); } /** @@ -356,8 +351,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in EnvironmentAccessModel is not found in the empty JSON string", EnvironmentAccessModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EnvironmentAccessModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("environmentId") != null && !jsonObj.get("environmentId").isJsonNull()) && !jsonObj.get("environmentId").isJsonPrimitive()) { + if (!jsonObj.get("environmentId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); } if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { @@ -369,10 +371,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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")); - } + // validate the required field `environmentAccessType` + EnvironmentAccessType.validateJsonElement(jsonObj.get("environmentAccessType")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 99b8d3c..cca082c 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 @@ -23,7 +23,6 @@ import java.io.IOException; import java.util.Arrays; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -52,7 +51,7 @@ /** * Details of the Environment. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class EnvironmentModel { public static final String SERIALIZED_NAME_PRODUCT = "product"; @SerializedName(SERIALIZED_NAME_PRODUCT) @@ -94,7 +93,7 @@ public EnvironmentModel product(ProductModel product) { * Get product * @return product */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public ProductModel getProduct() { return product; } @@ -113,7 +112,7 @@ public EnvironmentModel environmentId(UUID environmentId) { * Identifier of the Environment. * @return environmentId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getEnvironmentId() { return environmentId; } @@ -132,7 +131,7 @@ public EnvironmentModel name(String name) { * Name of the Environment. * @return name */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getName() { return name; } @@ -189,7 +188,7 @@ public EnvironmentModel order(Integer order) { * The order of the Environment represented on the ConfigCat Dashboard. * @return order */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Integer getOrder() { return order; } @@ -208,7 +207,7 @@ public EnvironmentModel reasonRequired(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 + @javax.annotation.Nonnull public Boolean getReasonRequired() { return reasonRequired; } @@ -282,22 +281,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, environmentModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(product, environmentId, name, color, description, order, reasonRequired, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -342,6 +330,13 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("product"); + openapiRequiredFields.add("environmentId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("color"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("order"); + openapiRequiredFields.add("reasonRequired"); } /** @@ -356,15 +351,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in EnvironmentModel is not found in the empty JSON string", EnvironmentModel.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `product` - if (jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) { - ProductModel.validateJsonElement(jsonObj.get("product")); + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EnvironmentModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } } - if ((jsonObj.get("environmentId") != null && !jsonObj.get("environmentId").isJsonNull()) && !jsonObj.get("environmentId").isJsonPrimitive()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `product` + ProductModel.validateJsonElement(jsonObj.get("product")); + if (!jsonObj.get("environmentId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + 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()) { 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 index 856d51d..6a6d48d 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/EvaluationVersion.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/EvaluationVersion.java @@ -24,7 +24,7 @@ import com.google.gson.stream.JsonWriter; /** - * Determines the evaluation version of a Config. Using `v2` enables the new features of Config V2 (https://configcat.com/docs/advanced/config-v2). + * 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 { 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 e28ba4f..25e18a5 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 @@ -49,7 +49,7 @@ /** * Subscription limitations regarding Feature flag or Setting values and targeting. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class FeatureFlagLimitations { public static final String SERIALIZED_NAME_MAX_PERCENTAGE_OPTION_COUNT = "maxPercentageOptionCount"; @SerializedName(SERIALIZED_NAME_MAX_PERCENTAGE_OPTION_COUNT) @@ -91,7 +91,7 @@ public FeatureFlagLimitations maxPercentageOptionCount(Integer maxPercentageOpti * Maximum number of percentage options a Feature Flag or Setting can have within a targeting rule. * @return maxPercentageOptionCount */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Integer getMaxPercentageOptionCount() { return maxPercentageOptionCount; } @@ -110,7 +110,7 @@ public FeatureFlagLimitations maxTargetingRuleCount(Integer maxTargetingRuleCoun * Maximum number of targeting rules a Feature Flag or Setting can have. * @return maxTargetingRuleCount */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Integer getMaxTargetingRuleCount() { return maxTargetingRuleCount; } @@ -129,7 +129,7 @@ public FeatureFlagLimitations maxComparisonValueLength(Integer maxComparisonValu * Maximum length of a text comparison value. * @return maxComparisonValueLength */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Integer getMaxComparisonValueLength() { return maxComparisonValueLength; } @@ -148,7 +148,7 @@ public FeatureFlagLimitations maxComparisonValueListLength(Integer maxComparison * Maximum item count of a list comparison value. * @return maxComparisonValueListLength */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Integer getMaxComparisonValueListLength() { return maxComparisonValueListLength; } @@ -167,7 +167,7 @@ public FeatureFlagLimitations maxComparisonValueListItemLength(Integer maxCompar * Maximum length of a list comparison value's item. * @return maxComparisonValueListItemLength */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Integer getMaxComparisonValueListItemLength() { return maxComparisonValueListItemLength; } @@ -186,7 +186,7 @@ public FeatureFlagLimitations maxStringFlagValueLength(Integer maxStringFlagValu * Maximum length of a text Setting's value. * @return maxStringFlagValueLength */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Integer getMaxStringFlagValueLength() { return maxStringFlagValueLength; } @@ -205,7 +205,7 @@ public FeatureFlagLimitations maxConditionPerTargetingRuleCount(Integer maxCondi * Maximum number of `AND` conditions a Feature Flag or Setting can have within a targeting rule. * @return maxConditionPerTargetingRuleCount */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Integer getMaxConditionPerTargetingRuleCount() { return maxConditionPerTargetingRuleCount; } @@ -328,6 +328,13 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("maxPercentageOptionCount"); + openapiRequiredFields.add("maxTargetingRuleCount"); + openapiRequiredFields.add("maxComparisonValueLength"); + openapiRequiredFields.add("maxComparisonValueListLength"); + openapiRequiredFields.add("maxComparisonValueListItemLength"); + openapiRequiredFields.add("maxStringFlagValueLength"); + openapiRequiredFields.add("maxConditionPerTargetingRuleCount"); } /** @@ -342,6 +349,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in FeatureFlagLimitations is not found in the empty JSON string", FeatureFlagLimitations.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FeatureFlagLimitations.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); } 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 71c946e..804e9a4 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 @@ -14,7 +14,7 @@ package com.configcat.publicapi.java.client.model; import java.util.Objects; -import com.configcat.publicapi.java.client.model.ReferenceLines; +import com.configcat.publicapi.java.client.model.ReferenceLinesRequest; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -52,7 +52,7 @@ /** * FlagReference */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class FlagReference { public static final String SERIALIZED_NAME_SETTING_ID = "settingId"; @SerializedName(SERIALIZED_NAME_SETTING_ID) @@ -60,7 +60,7 @@ public class FlagReference { public static final String SERIALIZED_NAME_REFERENCES = "references"; @SerializedName(SERIALIZED_NAME_REFERENCES) - private List references = new ArrayList<>(); + private List references = new ArrayList<>(); public FlagReference() { } @@ -84,12 +84,12 @@ public void setSettingId(Integer settingId) { } - public FlagReference references(List references) { + public FlagReference references(List references) { this.references = references; return this; } - public FlagReference addReferencesItem(ReferenceLines referencesItem) { + public FlagReference addReferencesItem(ReferenceLinesRequest referencesItem) { if (this.references == null) { this.references = new ArrayList<>(); } @@ -102,11 +102,11 @@ public FlagReference addReferencesItem(ReferenceLines referencesItem) { * @return references */ @javax.annotation.Nonnull - public List getReferences() { + public List getReferences() { return references; } - public void setReferences(List references) { + public void setReferences(List references) { this.references = references; } @@ -241,7 +241,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayreferences = jsonObj.getAsJsonArray("references"); // validate the required field `references` (array) for (int i = 0; i < jsonArrayreferences.size(); i++) { - ReferenceLines.validateJsonElement(jsonArrayreferences.get(i)); + ReferenceLinesRequest.validateJsonElement(jsonArrayreferences.get(i)); }; } 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 b11af2a..0255f5a 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 @@ -14,6 +14,7 @@ package com.configcat.publicapi.java.client.model; import java.util.Objects; +import com.configcat.publicapi.java.client.model.SettingValueType; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -22,7 +23,6 @@ import java.io.IOException; import java.util.Arrays; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -51,7 +51,7 @@ /** * InitialValue */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class InitialValue { public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) @@ -59,7 +59,7 @@ public class InitialValue { public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) - private Object value = null; + private SettingValueType value; public InitialValue() { } @@ -83,21 +83,21 @@ public void setEnvironmentId(UUID environmentId) { } - public InitialValue value(Object value) { + public InitialValue value(SettingValueType value) { this.value = value; return this; } /** - * The initial value in the given Environment. It must respect the setting type. + * The initial value in the given Environment. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. * @return value */ - @javax.annotation.Nullable - public Object getValue() { + @javax.annotation.Nonnull + public SettingValueType getValue() { return value; } - public void setValue(Object value) { + public void setValue(SettingValueType value) { this.value = value; } @@ -161,22 +161,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, initialValue.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(environmentId, value, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -211,6 +200,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("value"); } /** @@ -225,10 +215,19 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in InitialValue is not found in the empty JSON string", InitialValue.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InitialValue.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("environmentId") != null && !jsonObj.get("environmentId").isJsonNull()) && !jsonObj.get("environmentId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); } + // validate the required field `value` + SettingValueType.validateJsonElement(jsonObj.get("value")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 6deca96..ed5c5e6 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 @@ -25,7 +25,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -54,7 +53,7 @@ /** * IntegrationLinkDetail */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class IntegrationLinkDetail { public static final String SERIALIZED_NAME_PRODUCT = "product"; @SerializedName(SERIALIZED_NAME_PRODUCT) @@ -92,7 +91,7 @@ public IntegrationLinkDetail product(ProductModel product) { * Get product * @return product */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public ProductModel getProduct() { return product; } @@ -111,7 +110,7 @@ public IntegrationLinkDetail config(ConfigModel config) { * Get config * @return config */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public ConfigModel getConfig() { return config; } @@ -130,7 +129,7 @@ public IntegrationLinkDetail environment(EnvironmentModel environment) { * Get environment * @return environment */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public EnvironmentModel getEnvironment() { return environment; } @@ -149,7 +148,7 @@ public IntegrationLinkDetail setting(SettingDataModel setting) { * Get setting * @return setting */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public SettingDataModel getSetting() { return setting; } @@ -168,7 +167,7 @@ public IntegrationLinkDetail readOnly(Boolean readOnly) { * Get readOnly * @return readOnly */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getReadOnly() { return readOnly; } @@ -187,7 +186,7 @@ public IntegrationLinkDetail status(String status) { * Get status * @return status */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getStatus() { return status; } @@ -260,22 +259,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, integrationLinkDetail.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(product, config, environment, setting, readOnly, status, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -318,6 +306,12 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("product"); + openapiRequiredFields.add("config"); + openapiRequiredFields.add("environment"); + openapiRequiredFields.add("setting"); + openapiRequiredFields.add("readOnly"); + openapiRequiredFields.add("status"); } /** @@ -332,24 +326,23 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in IntegrationLinkDetail is not found in the empty JSON string", IntegrationLinkDetail.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `product` - if (jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) { - ProductModel.validateJsonElement(jsonObj.get("product")); - } - // validate the optional field `config` - if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { - ConfigModel.validateJsonElement(jsonObj.get("config")); - } - // validate the optional field `environment` - if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonNull()) { - EnvironmentModel.validateJsonElement(jsonObj.get("environment")); - } - // validate the optional field `setting` - if (jsonObj.get("setting") != null && !jsonObj.get("setting").isJsonNull()) { - SettingDataModel.validateJsonElement(jsonObj.get("setting")); + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IntegrationLinkDetail.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } } - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `product` + ProductModel.validateJsonElement(jsonObj.get("product")); + // validate the required field `config` + ConfigModel.validateJsonElement(jsonObj.get("config")); + // validate the required field `environment` + EnvironmentModel.validateJsonElement(jsonObj.get("environment")); + // validate the required field `setting` + SettingDataModel.validateJsonElement(jsonObj.get("setting")); + if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } } 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 6f5d2fa..3c8bdb4 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 @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -53,7 +52,7 @@ /** * IntegrationLinkDetailsModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class IntegrationLinkDetailsModel { public static final String SERIALIZED_NAME_DETAILS = "details"; @SerializedName(SERIALIZED_NAME_DETAILS) @@ -93,7 +92,7 @@ public IntegrationLinkDetailsModel allIntegrationLinkCount(Integer allIntegratio * Get allIntegrationLinkCount * @return allIntegrationLinkCount */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Integer getAllIntegrationLinkCount() { return allIntegrationLinkCount; } @@ -162,22 +161,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, integrationLinkDetailsModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(details, allIntegrationLinkCount, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -212,6 +200,8 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("details"); + openapiRequiredFields.add("allIntegrationLinkCount"); } /** @@ -226,21 +216,24 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in IntegrationLinkDetailsModel is not found in the empty JSON string", IntegrationLinkDetailsModel.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("details") != null && !jsonObj.get("details").isJsonNull()) { - JsonArray jsonArraydetails = jsonObj.getAsJsonArray("details"); - if (jsonArraydetails != null) { - // ensure the json data is an array - if (!jsonObj.get("details").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `details` to be an array in the JSON string but got `%s`", jsonObj.get("details").toString())); - } - - // validate the optional field `details` (array) - for (int i = 0; i < jsonArraydetails.size(); i++) { - IntegrationLinkDetail.validateJsonElement(jsonArraydetails.get(i)); - }; + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IntegrationLinkDetailsModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("details").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `details` to be an array in the JSON string but got `%s`", jsonObj.get("details").toString())); + } + + JsonArray jsonArraydetails = jsonObj.getAsJsonArray("details"); + // validate the required field `details` (array) + for (int i = 0; i < jsonArraydetails.size(); i++) { + IntegrationLinkDetail.validateJsonElement(jsonArraydetails.get(i)); + }; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 acd8456..e2e7612 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 @@ -22,7 +22,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -51,7 +50,7 @@ /** * IntegrationLinkModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class IntegrationLinkModel { public static final String SERIALIZED_NAME_KEY = "key"; @SerializedName(SERIALIZED_NAME_KEY) @@ -119,7 +118,7 @@ public IntegrationLinkModel integrationLinkType(IntegrationLinkType integrationL * Get integrationLinkType * @return integrationLinkType */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public IntegrationLinkType getIntegrationLinkType() { return integrationLinkType; } @@ -209,22 +208,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, integrationLinkModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(key, description, integrationLinkType, url, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -263,6 +251,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("integrationLinkType"); + openapiRequiredFields.add("url"); } /** @@ -277,6 +269,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in IntegrationLinkModel is not found in the empty JSON string", IntegrationLinkModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IntegrationLinkModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("key") != null && !jsonObj.get("key").isJsonNull()) && !jsonObj.get("key").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); @@ -284,10 +283,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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")); - } + // validate the required field `integrationLinkType` + IntegrationLinkType.validateJsonElement(jsonObj.get("integrationLinkType")); if ((jsonObj.get("url") != null && !jsonObj.get("url").isJsonNull()) && !jsonObj.get("url").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } 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 0e6abed..8f5d055 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 @@ -28,7 +28,6 @@ import java.util.List; import java.util.Map; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -57,7 +56,7 @@ /** * Details of the Integration. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class IntegrationModel { public static final String SERIALIZED_NAME_PRODUCT = "product"; @SerializedName(SERIALIZED_NAME_PRODUCT) @@ -81,11 +80,11 @@ public class IntegrationModel { public static final String SERIALIZED_NAME_ENVIRONMENT_IDS = "environmentIds"; @SerializedName(SERIALIZED_NAME_ENVIRONMENT_IDS) - private List environmentIds; + private List environmentIds = new ArrayList<>(); public static final String SERIALIZED_NAME_CONFIG_IDS = "configIds"; @SerializedName(SERIALIZED_NAME_CONFIG_IDS) - private List configIds; + private List configIds = new ArrayList<>(); public IntegrationModel() { } @@ -99,7 +98,7 @@ public IntegrationModel product(ProductModel product) { * Get product * @return product */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public ProductModel getProduct() { return product; } @@ -118,7 +117,7 @@ public IntegrationModel integrationId(UUID integrationId) { * Identifier of the Integration. * @return integrationId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getIntegrationId() { return integrationId; } @@ -137,7 +136,7 @@ public IntegrationModel name(String name) { * Name of the Integration. * @return name */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getName() { return name; } @@ -156,7 +155,7 @@ public IntegrationModel integrationType(IntegrationType integrationType) { * Get integrationType * @return integrationType */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public IntegrationType getIntegrationType() { return integrationType; } @@ -210,7 +209,7 @@ public IntegrationModel addEnvironmentIdsItem(UUID environmentIdsItem) { * 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 + @javax.annotation.Nonnull public List getEnvironmentIds() { return environmentIds; } @@ -237,7 +236,7 @@ public IntegrationModel addConfigIdsItem(UUID configIdsItem) { * 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 + @javax.annotation.Nonnull public List getConfigIds() { return configIds; } @@ -311,22 +310,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, integrationModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(product, integrationId, name, integrationType, parameters, environmentIds, configIds, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -371,6 +359,13 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("product"); + openapiRequiredFields.add("integrationId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("integrationType"); + openapiRequiredFields.add("parameters"); + openapiRequiredFields.add("environmentIds"); + openapiRequiredFields.add("configIds"); } /** @@ -385,27 +380,34 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in IntegrationModel is not found in the empty JSON string", IntegrationModel.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `product` - if (jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) { - ProductModel.validateJsonElement(jsonObj.get("product")); + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IntegrationModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } } - if ((jsonObj.get("integrationId") != null && !jsonObj.get("integrationId").isJsonNull()) && !jsonObj.get("integrationId").isJsonPrimitive()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `product` + ProductModel.validateJsonElement(jsonObj.get("product")); + if (!jsonObj.get("integrationId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `integrationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("integrationId").toString())); } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + 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 `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()) { + // validate the required field `integrationType` + IntegrationType.validateJsonElement(jsonObj.get("integrationType")); + // ensure the required json array is present + if (jsonObj.get("environmentIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("environmentIds").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `environmentIds` to be an array in the JSON string but got `%s`", jsonObj.get("environmentIds").toString())); } - // ensure the optional json data is an array if present - if (jsonObj.get("configIds") != null && !jsonObj.get("configIds").isJsonNull() && !jsonObj.get("configIds").isJsonArray()) { + // 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())); } } 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 ef1d164..6a05026 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 @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -53,7 +52,7 @@ /** * IntegrationsModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class IntegrationsModel { public static final String SERIALIZED_NAME_INTEGRATIONS = "integrations"; @SerializedName(SERIALIZED_NAME_INTEGRATIONS) @@ -147,22 +146,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, integrationsModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(integrations, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -195,6 +183,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("integrations"); } /** @@ -209,21 +198,24 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in IntegrationsModel is not found in the empty JSON string", IntegrationsModel.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("integrations") != null && !jsonObj.get("integrations").isJsonNull()) { - JsonArray jsonArrayintegrations = jsonObj.getAsJsonArray("integrations"); - if (jsonArrayintegrations != null) { - // ensure the json data is an array - if (!jsonObj.get("integrations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `integrations` to be an array in the JSON string but got `%s`", jsonObj.get("integrations").toString())); - } - - // validate the optional field `integrations` (array) - for (int i = 0; i < jsonArrayintegrations.size(); i++) { - IntegrationModel.validateJsonElement(jsonArrayintegrations.get(i)); - }; + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IntegrationsModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("integrations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `integrations` to be an array in the JSON string but got `%s`", jsonObj.get("integrations").toString())); + } + + JsonArray jsonArrayintegrations = jsonObj.getAsJsonArray("integrations"); + // validate the required field `integrations` (array) + for (int i = 0; i < jsonArrayintegrations.size(); i++) { + IntegrationModel.validateJsonElement(jsonArrayintegrations.get(i)); + }; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 1f30b3d..c2716f4 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 @@ -23,7 +23,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -52,7 +51,7 @@ /** * InvitationModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class InvitationModel { public static final String SERIALIZED_NAME_INVITATION_ID = "invitationId"; @SerializedName(SERIALIZED_NAME_INVITATION_ID) @@ -86,7 +85,7 @@ public InvitationModel invitationId(UUID invitationId) { * The identifier of the Invitation. * @return invitationId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getInvitationId() { return invitationId; } @@ -124,7 +123,7 @@ public InvitationModel permissionGroupId(Long permissionGroupId) { * The identifier of the Permission Group the user was invited to. * @return permissionGroupId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Long getPermissionGroupId() { return permissionGroupId; } @@ -143,7 +142,7 @@ public InvitationModel createdAt(OffsetDateTime createdAt) { * Creation time of the Invitation. * @return createdAt */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public OffsetDateTime getCreatedAt() { return createdAt; } @@ -162,7 +161,7 @@ public InvitationModel expired(Boolean expired) { * Determines whether the Invitation is expired. * @return expired */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getExpired() { return expired; } @@ -234,22 +233,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, invitationModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(invitationId, email, permissionGroupId, createdAt, expired, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -290,6 +278,11 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("invitationId"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("permissionGroupId"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("expired"); } /** @@ -304,8 +297,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in InvitationModel is not found in the empty JSON string", InvitationModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvitationModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("invitationId") != null && !jsonObj.get("invitationId").isJsonNull()) && !jsonObj.get("invitationId").isJsonPrimitive()) { + if (!jsonObj.get("invitationId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `invitationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invitationId").toString())); } if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { 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 f2529c0..93fc5f5 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 @@ -51,7 +51,7 @@ /** * InviteMembersRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class InviteMembersRequest { public static final String SERIALIZED_NAME_EMAILS = "emails"; @SerializedName(SERIALIZED_NAME_EMAILS) 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 3b6cbc1..274c358 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 @@ -51,7 +51,7 @@ /** * JsonPatchOperation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class JsonPatchOperation { public static final String SERIALIZED_NAME_OP = "op"; @SerializedName(SERIALIZED_NAME_OP) 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 644f843..b275449 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 @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -50,7 +49,7 @@ /** * MeModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class MeModel { public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) @@ -76,7 +75,7 @@ public MeModel( * Get email * @return email */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getEmail() { return email; } @@ -87,7 +86,7 @@ public String getEmail() { * Get fullName * @return fullName */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getFullName() { return fullName; } @@ -153,22 +152,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, meModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(email, fullName, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -203,6 +191,8 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("fullName"); } /** @@ -217,11 +207,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in MeModel is not found in the empty JSON string", MeModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MeModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + if (!jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } - if ((jsonObj.get("fullName") != null && !jsonObj.get("fullName").isJsonNull()) && !jsonObj.get("fullName").isJsonPrimitive()) { + if (!jsonObj.get("fullName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); } } 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 5e320e0..f0145b5 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 @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -51,7 +50,7 @@ /** * MemberModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class MemberModel { public static final String SERIALIZED_NAME_USER_ID = "userId"; @SerializedName(SERIALIZED_NAME_USER_ID) @@ -104,7 +103,7 @@ public MemberModel productId(UUID productId) { * Identifier of the Product where the Member has access. * @return productId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getProductId() { return productId; } @@ -123,7 +122,7 @@ public MemberModel permissionGroupId(Long permissionGroupId) { * Identifier of the Member's Permission Group. * @return permissionGroupId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Long getPermissionGroupId() { return permissionGroupId; } @@ -233,22 +232,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, memberModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(userId, productId, permissionGroupId, fullName, email, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -289,6 +277,11 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userId"); + openapiRequiredFields.add("productId"); + openapiRequiredFields.add("permissionGroupId"); + openapiRequiredFields.add("fullName"); + openapiRequiredFields.add("email"); } /** @@ -303,11 +296,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in MemberModel is not found in the empty JSON string", MemberModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MemberModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("userId") != null && !jsonObj.get("userId").isJsonNull()) && !jsonObj.get("userId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString())); } - if ((jsonObj.get("productId") != null && !jsonObj.get("productId").isJsonNull()) && !jsonObj.get("productId").isJsonPrimitive()) { + if (!jsonObj.get("productId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `productId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productId").toString())); } if ((jsonObj.get("fullName") != null && !jsonObj.get("fullName").isJsonNull()) && !jsonObj.get("fullName").isJsonPrimitive()) { 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 69ef07d..f49817c 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 @@ -54,7 +54,7 @@ /** * ModifyIntegrationRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class ModifyIntegrationRequest { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) 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 96954d7..dab893d 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 @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -50,7 +49,7 @@ /** * Describes an Organization Admin. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class OrganizationAdminModel { public static final String SERIALIZED_NAME_USER_ID = "userId"; @SerializedName(SERIALIZED_NAME_USER_ID) @@ -80,7 +79,7 @@ public OrganizationAdminModel userId(String userId) { * Identifier of the Organization Admin. * @return userId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getUserId() { return userId; } @@ -99,7 +98,7 @@ public OrganizationAdminModel fullName(String fullName) { * Name of the Organization Admin. * @return fullName */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getFullName() { return fullName; } @@ -118,7 +117,7 @@ public OrganizationAdminModel email(String email) { * Email of the OrganizationAdmin. * @return email */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getEmail() { return email; } @@ -137,7 +136,7 @@ public OrganizationAdminModel twoFactorEnabled(Boolean twoFactorEnabled) { * Determines whether 2FA is enabled for the Organization Admin. * @return twoFactorEnabled */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getTwoFactorEnabled() { return twoFactorEnabled; } @@ -208,22 +207,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, organizationAdminModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(userId, fullName, email, twoFactorEnabled, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -262,6 +250,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userId"); + openapiRequiredFields.add("fullName"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("twoFactorEnabled"); } /** @@ -276,14 +268,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationAdminModel is not found in the empty JSON string", OrganizationAdminModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrganizationAdminModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("userId") != null && !jsonObj.get("userId").isJsonNull()) && !jsonObj.get("userId").isJsonPrimitive()) { + if (!jsonObj.get("userId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString())); } - if ((jsonObj.get("fullName") != null && !jsonObj.get("fullName").isJsonNull()) && !jsonObj.get("fullName").isJsonPrimitive()) { + if (!jsonObj.get("fullName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); } - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + if (!jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } } 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 81065c9..2c92c70 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 @@ -23,7 +23,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -52,7 +51,7 @@ /** * OrganizationInvitationModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class OrganizationInvitationModel { public static final String SERIALIZED_NAME_INVITATION_ID = "invitationId"; @SerializedName(SERIALIZED_NAME_INVITATION_ID) @@ -98,7 +97,7 @@ public OrganizationInvitationModel invitationId(UUID invitationId) { * The identifier of the Invitation. * @return invitationId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getInvitationId() { return invitationId; } @@ -136,7 +135,7 @@ public OrganizationInvitationModel productId(UUID productId) { * The identifier of the Product the user was invited to. * @return productId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getProductId() { return productId; } @@ -174,7 +173,7 @@ public OrganizationInvitationModel permissionGroupId(Long permissionGroupId) { * The identifier of the Permission Group the user was invited to. * @return permissionGroupId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Long getPermissionGroupId() { return permissionGroupId; } @@ -193,7 +192,7 @@ public OrganizationInvitationModel createdAt(OffsetDateTime createdAt) { * Creation time of the Invitation. * @return createdAt */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public OffsetDateTime getCreatedAt() { return createdAt; } @@ -212,7 +211,7 @@ public OrganizationInvitationModel expired(Boolean expired) { * Determines whether the Invitation is expired. * @return expired */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getExpired() { return expired; } @@ -231,7 +230,7 @@ public OrganizationInvitationModel expires(OffsetDateTime expires) { * Expiration time of the Invitation. * @return expires */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public OffsetDateTime getExpires() { return expires; } @@ -306,22 +305,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, organizationInvitationModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(invitationId, email, productId, productName, permissionGroupId, createdAt, expired, expires, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -368,6 +356,14 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("invitationId"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("productId"); + openapiRequiredFields.add("productName"); + openapiRequiredFields.add("permissionGroupId"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("expired"); + openapiRequiredFields.add("expires"); } /** @@ -382,14 +378,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationInvitationModel is not found in the empty JSON string", OrganizationInvitationModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrganizationInvitationModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("invitationId") != null && !jsonObj.get("invitationId").isJsonNull()) && !jsonObj.get("invitationId").isJsonPrimitive()) { + if (!jsonObj.get("invitationId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `invitationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invitationId").toString())); } if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } - if ((jsonObj.get("productId") != null && !jsonObj.get("productId").isJsonNull()) && !jsonObj.get("productId").isJsonPrimitive()) { + if (!jsonObj.get("productId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `productId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productId").toString())); } if ((jsonObj.get("productName") != null && !jsonObj.get("productName").isJsonNull()) && !jsonObj.get("productName").isJsonPrimitive()) { 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 1ba9ba6..d458563 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 @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -53,7 +52,7 @@ /** * Describes an Organization Member. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class OrganizationMemberModel { public static final String SERIALIZED_NAME_USER_ID = "userId"; @SerializedName(SERIALIZED_NAME_USER_ID) @@ -73,7 +72,7 @@ public class OrganizationMemberModel { public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; @SerializedName(SERIALIZED_NAME_PERMISSIONS) - private List permissions; + private List permissions = new ArrayList<>(); public OrganizationMemberModel() { } @@ -87,7 +86,7 @@ public OrganizationMemberModel userId(String userId) { * Identifier of the Organization Admin. * @return userId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getUserId() { return userId; } @@ -106,7 +105,7 @@ public OrganizationMemberModel fullName(String fullName) { * Name of the Organization Admin. * @return fullName */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getFullName() { return fullName; } @@ -125,7 +124,7 @@ public OrganizationMemberModel email(String email) { * Email of the OrganizationAdmin. * @return email */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getEmail() { return email; } @@ -144,7 +143,7 @@ public OrganizationMemberModel twoFactorEnabled(Boolean twoFactorEnabled) { * Determines whether 2FA is enabled for the Organization Admin. * @return twoFactorEnabled */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getTwoFactorEnabled() { return twoFactorEnabled; } @@ -171,7 +170,7 @@ public OrganizationMemberModel addPermissionsItem(OrganizationPermissionModel pe * The permissions of the Member. * @return permissions */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getPermissions() { return permissions; } @@ -243,22 +242,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, organizationMemberModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(userId, fullName, email, twoFactorEnabled, permissions, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -299,6 +287,11 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userId"); + openapiRequiredFields.add("fullName"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("twoFactorEnabled"); + openapiRequiredFields.add("permissions"); } /** @@ -313,30 +306,33 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationMemberModel is not found in the empty JSON string", OrganizationMemberModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrganizationMemberModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("userId") != null && !jsonObj.get("userId").isJsonNull()) && !jsonObj.get("userId").isJsonPrimitive()) { + if (!jsonObj.get("userId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString())); } - if ((jsonObj.get("fullName") != null && !jsonObj.get("fullName").isJsonNull()) && !jsonObj.get("fullName").isJsonPrimitive()) { + if (!jsonObj.get("fullName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); } - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + if (!jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } - if (jsonObj.get("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)); - }; - } + // ensure the json data is an array + if (!jsonObj.get("permissions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `permissions` to be an array in the JSON string but got `%s`", jsonObj.get("permissions").toString())); } + + JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); + // validate the required field `permissions` (array) + for (int i = 0; i < jsonArraypermissions.size(); i++) { + OrganizationPermissionModel.validateJsonElement(jsonArraypermissions.get(i)); + }; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 c24fa22..1f70504 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 @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -54,19 +53,19 @@ /** * OrganizationMembersModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class OrganizationMembersModel { public static final String SERIALIZED_NAME_ADMINS = "admins"; @SerializedName(SERIALIZED_NAME_ADMINS) - private List admins; + private List admins = new ArrayList<>(); public static final String SERIALIZED_NAME_BILLING_MANAGERS = "billingManagers"; @SerializedName(SERIALIZED_NAME_BILLING_MANAGERS) - private List billingManagers; + private List billingManagers = new ArrayList<>(); public static final String SERIALIZED_NAME_MEMBERS = "members"; @SerializedName(SERIALIZED_NAME_MEMBERS) - private List members; + private List members = new ArrayList<>(); public OrganizationMembersModel() { } @@ -88,7 +87,7 @@ public OrganizationMembersModel addAdminsItem(OrganizationAdminModel adminsItem) * List of Organization Admins. * @return admins */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getAdmins() { return admins; } @@ -115,7 +114,7 @@ public OrganizationMembersModel addBillingManagersItem(OrganizationAdminModel bi * List of Billing Managers. * @return billingManagers */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getBillingManagers() { return billingManagers; } @@ -142,7 +141,7 @@ public OrganizationMembersModel addMembersItem(OrganizationMemberModel membersIt * List of Organization Members. * @return members */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getMembers() { return members; } @@ -212,22 +211,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, organizationMembersModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(admins, billingManagers, members, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -264,6 +252,9 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("admins"); + openapiRequiredFields.add("billingManagers"); + openapiRequiredFields.add("members"); } /** @@ -278,49 +269,44 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationMembersModel is not found in the empty JSON string", OrganizationMembersModel.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("admins") != null && !jsonObj.get("admins").isJsonNull()) { - JsonArray jsonArrayadmins = jsonObj.getAsJsonArray("admins"); - if (jsonArrayadmins != null) { - // ensure the json data is an array - if (!jsonObj.get("admins").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `admins` to be an array in the JSON string but got `%s`", jsonObj.get("admins").toString())); - } - - // validate the optional field `admins` (array) - for (int i = 0; i < jsonArrayadmins.size(); i++) { - OrganizationAdminModel.validateJsonElement(jsonArrayadmins.get(i)); - }; + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrganizationMembersModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } - 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)); - }; - } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("admins").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `admins` to be an array in the JSON string but got `%s`", jsonObj.get("admins").toString())); } - 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)); - }; - } + + JsonArray jsonArrayadmins = jsonObj.getAsJsonArray("admins"); + // validate the required field `admins` (array) + for (int i = 0; i < jsonArrayadmins.size(); i++) { + OrganizationAdminModel.validateJsonElement(jsonArrayadmins.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("billingManagers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `billingManagers` to be an array in the JSON string but got `%s`", jsonObj.get("billingManagers").toString())); } + + JsonArray jsonArraybillingManagers = jsonObj.getAsJsonArray("billingManagers"); + // validate the required field `billingManagers` (array) + for (int i = 0; i < jsonArraybillingManagers.size(); i++) { + OrganizationAdminModel.validateJsonElement(jsonArraybillingManagers.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("members").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `members` to be an array in the JSON string but got `%s`", jsonObj.get("members").toString())); + } + + JsonArray jsonArraymembers = jsonObj.getAsJsonArray("members"); + // validate the required field `members` (array) + for (int i = 0; i < jsonArraymembers.size(); i++) { + OrganizationMemberModel.validateJsonElement(jsonArraymembers.get(i)); + }; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 fd7f38a..341048c 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 @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -51,7 +50,7 @@ /** * Details of the Organization. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class OrganizationModel { public static final String SERIALIZED_NAME_ORGANIZATION_ID = "organizationId"; @SerializedName(SERIALIZED_NAME_ORGANIZATION_ID) @@ -73,7 +72,7 @@ public OrganizationModel organizationId(UUID organizationId) { * Identifier of the Organization. * @return organizationId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getOrganizationId() { return organizationId; } @@ -92,7 +91,7 @@ public OrganizationModel name(String name) { * Name of the Organization. * @return name */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getName() { return name; } @@ -161,22 +160,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, organizationModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(organizationId, name, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -211,6 +199,8 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("organizationId"); + openapiRequiredFields.add("name"); } /** @@ -225,11 +215,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationModel is not found in the empty JSON string", OrganizationModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrganizationModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("organizationId") != null && !jsonObj.get("organizationId").isJsonNull()) && !jsonObj.get("organizationId").isJsonPrimitive()) { + if (!jsonObj.get("organizationId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `organizationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("organizationId").toString())); } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + 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())); } } 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 08e98db..aed6e30 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 @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -50,7 +49,7 @@ /** * Describes the Member's Permission Group within a Product. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class OrganizationPermissionGroupModel { public static final String SERIALIZED_NAME_PERMISSION_GROUP_ID = "permissionGroupId"; @SerializedName(SERIALIZED_NAME_PERMISSION_GROUP_ID) @@ -72,7 +71,7 @@ public OrganizationPermissionGroupModel permissionGroupId(Long permissionGroupId * Identifier of the Member's Permission Group. * @return permissionGroupId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Long getPermissionGroupId() { return permissionGroupId; } @@ -91,7 +90,7 @@ public OrganizationPermissionGroupModel name(String name) { * Name of the Member's Permission Group. * @return name */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getName() { return name; } @@ -160,22 +159,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, organizationPermissionGroupModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(permissionGroupId, name, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -210,6 +198,8 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("permissionGroupId"); + openapiRequiredFields.add("name"); } /** @@ -224,8 +214,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationPermissionGroupModel is not found in the empty JSON string", OrganizationPermissionGroupModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrganizationPermissionGroupModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + 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())); } } 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 f5134bd..e23f065 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 @@ -51,7 +51,7 @@ /** * Describes the Member's permission. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class OrganizationPermissionModel { public static final String SERIALIZED_NAME_PRODUCT = "product"; @SerializedName(SERIALIZED_NAME_PRODUCT) @@ -73,7 +73,7 @@ public OrganizationPermissionModel product(OrganizationProductModel product) { * Get product * @return product */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public OrganizationProductModel getProduct() { return product; } @@ -92,7 +92,7 @@ public OrganizationPermissionModel permissionGroup(OrganizationPermissionGroupMo * Get permissionGroup * @return permissionGroup */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public OrganizationPermissionGroupModel getPermissionGroup() { return permissionGroup; } @@ -200,6 +200,8 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("product"); + openapiRequiredFields.add("permissionGroup"); } /** @@ -214,15 +216,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationPermissionModel is not found in the empty JSON string", OrganizationPermissionModel.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `product` - if (jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) { - OrganizationProductModel.validateJsonElement(jsonObj.get("product")); - } - // validate the optional field `permissionGroup` - if (jsonObj.get("permissionGroup") != null && !jsonObj.get("permissionGroup").isJsonNull()) { - OrganizationPermissionGroupModel.validateJsonElement(jsonObj.get("permissionGroup")); + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrganizationPermissionModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `product` + OrganizationProductModel.validateJsonElement(jsonObj.get("product")); + // validate the required field `permissionGroup` + OrganizationPermissionGroupModel.validateJsonElement(jsonObj.get("permissionGroup")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 71655d1..7d12435 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 @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -51,7 +50,7 @@ /** * Describes the Member's Product. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class OrganizationProductModel { public static final String SERIALIZED_NAME_PRODUCT_ID = "productId"; @SerializedName(SERIALIZED_NAME_PRODUCT_ID) @@ -73,7 +72,7 @@ public OrganizationProductModel productId(UUID productId) { * Identifier of the Member's Product. * @return productId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getProductId() { return productId; } @@ -92,7 +91,7 @@ public OrganizationProductModel name(String name) { * Name of the Member's Product. * @return name */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getName() { return name; } @@ -161,22 +160,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, organizationProductModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(productId, name, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -211,6 +199,8 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("productId"); + openapiRequiredFields.add("name"); } /** @@ -225,11 +215,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationProductModel is not found in the empty JSON string", OrganizationProductModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrganizationProductModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("productId") != null && !jsonObj.get("productId").isJsonNull()) && !jsonObj.get("productId").isJsonPrimitive()) { + if (!jsonObj.get("productId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `productId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productId").toString())); } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + 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())); } } 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 ac8af98..a17fe7d 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 @@ -50,7 +50,7 @@ /** * PercentageOptionModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class PercentageOptionModel { public static final String SERIALIZED_NAME_PERCENTAGE = "percentage"; @SerializedName(SERIALIZED_NAME_PERCENTAGE) 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 12b5589..fb2d11e 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 @@ -27,7 +27,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -56,7 +55,7 @@ /** * PermissionGroupModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class PermissionGroupModel { public static final String SERIALIZED_NAME_PERMISSION_GROUP_ID = "permissionGroupId"; @SerializedName(SERIALIZED_NAME_PERMISSION_GROUP_ID) @@ -160,7 +159,7 @@ public class PermissionGroupModel { public static final String SERIALIZED_NAME_ENVIRONMENT_ACCESSES = "environmentAccesses"; @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ACCESSES) - private List environmentAccesses; + private List environmentAccesses = new ArrayList<>(); public static final String SERIALIZED_NAME_PRODUCT = "product"; @SerializedName(SERIALIZED_NAME_PRODUCT) @@ -178,7 +177,7 @@ public PermissionGroupModel permissionGroupId(Long permissionGroupId) { * Identifier of the Permission Group. * @return permissionGroupId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Long getPermissionGroupId() { return permissionGroupId; } @@ -197,7 +196,7 @@ public PermissionGroupModel name(String name) { * Name of the Permission Group. * @return name */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getName() { return name; } @@ -216,7 +215,7 @@ public PermissionGroupModel canManageMembers(Boolean canManageMembers) { * Group members can manage team members. * @return canManageMembers */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanManageMembers() { return canManageMembers; } @@ -235,7 +234,7 @@ public PermissionGroupModel canCreateOrUpdateConfig(Boolean canCreateOrUpdateCon * Group members can create/update Configs. * @return canCreateOrUpdateConfig */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanCreateOrUpdateConfig() { return canCreateOrUpdateConfig; } @@ -254,7 +253,7 @@ public PermissionGroupModel canDeleteConfig(Boolean canDeleteConfig) { * Group members can delete Configs. * @return canDeleteConfig */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanDeleteConfig() { return canDeleteConfig; } @@ -273,7 +272,7 @@ public PermissionGroupModel canCreateOrUpdateEnvironment(Boolean canCreateOrUpda * Group members can create/update Environments. * @return canCreateOrUpdateEnvironment */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanCreateOrUpdateEnvironment() { return canCreateOrUpdateEnvironment; } @@ -292,7 +291,7 @@ public PermissionGroupModel canDeleteEnvironment(Boolean canDeleteEnvironment) { * Group members can delete Environments. * @return canDeleteEnvironment */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanDeleteEnvironment() { return canDeleteEnvironment; } @@ -311,7 +310,7 @@ public PermissionGroupModel canCreateOrUpdateSetting(Boolean canCreateOrUpdateSe * Group members can create/update Feature Flags and Settings. * @return canCreateOrUpdateSetting */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanCreateOrUpdateSetting() { return canCreateOrUpdateSetting; } @@ -330,7 +329,7 @@ public PermissionGroupModel canTagSetting(Boolean canTagSetting) { * Group members can attach/detach Tags to Feature Flags and Settings. * @return canTagSetting */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanTagSetting() { return canTagSetting; } @@ -349,7 +348,7 @@ public PermissionGroupModel canDeleteSetting(Boolean canDeleteSetting) { * Group members can delete Feature Flags and Settings. * @return canDeleteSetting */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanDeleteSetting() { return canDeleteSetting; } @@ -368,7 +367,7 @@ public PermissionGroupModel canCreateOrUpdateTag(Boolean canCreateOrUpdateTag) { * Group members can create/update Tags. * @return canCreateOrUpdateTag */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanCreateOrUpdateTag() { return canCreateOrUpdateTag; } @@ -387,7 +386,7 @@ public PermissionGroupModel canDeleteTag(Boolean canDeleteTag) { * Group members can delete Tags. * @return canDeleteTag */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanDeleteTag() { return canDeleteTag; } @@ -406,7 +405,7 @@ public PermissionGroupModel canManageWebhook(Boolean canManageWebhook) { * Group members can create/update/delete Webhooks. * @return canManageWebhook */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanManageWebhook() { return canManageWebhook; } @@ -425,7 +424,7 @@ public PermissionGroupModel canUseExportImport(Boolean canUseExportImport) { * Group members can use the export/import feature. * @return canUseExportImport */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanUseExportImport() { return canUseExportImport; } @@ -444,7 +443,7 @@ public PermissionGroupModel canManageProductPreferences(Boolean canManageProduct * Group members can update Product preferences. * @return canManageProductPreferences */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanManageProductPreferences() { return canManageProductPreferences; } @@ -463,7 +462,7 @@ public PermissionGroupModel canManageIntegrations(Boolean canManageIntegrations) * Group members can add and configure integrations. * @return canManageIntegrations */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanManageIntegrations() { return canManageIntegrations; } @@ -482,7 +481,7 @@ public PermissionGroupModel canViewSdkKey(Boolean canViewSdkKey) { * Group members has access to SDK keys. * @return canViewSdkKey */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanViewSdkKey() { return canViewSdkKey; } @@ -501,7 +500,7 @@ public PermissionGroupModel canRotateSdkKey(Boolean canRotateSdkKey) { * Group members can rotate SDK keys. * @return canRotateSdkKey */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanRotateSdkKey() { return canRotateSdkKey; } @@ -520,7 +519,7 @@ public PermissionGroupModel canCreateOrUpdateSegments(Boolean canCreateOrUpdateS * Group members can create/update Segments. * @return canCreateOrUpdateSegments */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanCreateOrUpdateSegments() { return canCreateOrUpdateSegments; } @@ -539,7 +538,7 @@ public PermissionGroupModel canDeleteSegments(Boolean canDeleteSegments) { * Group members can delete Segments. * @return canDeleteSegments */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanDeleteSegments() { return canDeleteSegments; } @@ -558,7 +557,7 @@ public PermissionGroupModel canViewProductAuditLog(Boolean canViewProductAuditLo * Group members has access to audit logs. * @return canViewProductAuditLog */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanViewProductAuditLog() { return canViewProductAuditLog; } @@ -577,7 +576,7 @@ public PermissionGroupModel canViewProductStatistics(Boolean canViewProductStati * Group members has access to product statistics. * @return canViewProductStatistics */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanViewProductStatistics() { return canViewProductStatistics; } @@ -596,7 +595,7 @@ public PermissionGroupModel canDisable2FA(Boolean canDisable2FA) { * Group members can disable two-factor authentication for other members. * @return canDisable2FA */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getCanDisable2FA() { return canDisable2FA; } @@ -615,7 +614,7 @@ public PermissionGroupModel accessType(AccessType accessType) { * Get accessType * @return accessType */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public AccessType getAccessType() { return accessType; } @@ -634,7 +633,7 @@ public PermissionGroupModel newEnvironmentAccessType(EnvironmentAccessType newEn * Get newEnvironmentAccessType * @return newEnvironmentAccessType */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public EnvironmentAccessType getNewEnvironmentAccessType() { return newEnvironmentAccessType; } @@ -661,7 +660,7 @@ public PermissionGroupModel addEnvironmentAccessesItem(EnvironmentAccessModel en * List of environment specific permissions. * @return environmentAccesses */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getEnvironmentAccesses() { return environmentAccesses; } @@ -680,7 +679,7 @@ public PermissionGroupModel product(ProductModel product) { * Get product * @return product */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public ProductModel getProduct() { return product; } @@ -774,22 +773,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, permissionGroupModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(permissionGroupId, name, canManageMembers, canCreateOrUpdateConfig, canDeleteConfig, canCreateOrUpdateEnvironment, canDeleteEnvironment, canCreateOrUpdateSetting, canTagSetting, canDeleteSetting, canCreateOrUpdateTag, canDeleteTag, canManageWebhook, canUseExportImport, canManageProductPreferences, canManageIntegrations, canViewSdkKey, canRotateSdkKey, canCreateOrUpdateSegments, canDeleteSegments, canViewProductAuditLog, canViewProductStatistics, canDisable2FA, accessType, newEnvironmentAccessType, environmentAccesses, product, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -874,6 +862,33 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("permissionGroupId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("canManageMembers"); + openapiRequiredFields.add("canCreateOrUpdateConfig"); + openapiRequiredFields.add("canDeleteConfig"); + openapiRequiredFields.add("canCreateOrUpdateEnvironment"); + openapiRequiredFields.add("canDeleteEnvironment"); + openapiRequiredFields.add("canCreateOrUpdateSetting"); + openapiRequiredFields.add("canTagSetting"); + openapiRequiredFields.add("canDeleteSetting"); + openapiRequiredFields.add("canCreateOrUpdateTag"); + openapiRequiredFields.add("canDeleteTag"); + openapiRequiredFields.add("canManageWebhook"); + openapiRequiredFields.add("canUseExportImport"); + openapiRequiredFields.add("canManageProductPreferences"); + openapiRequiredFields.add("canManageIntegrations"); + openapiRequiredFields.add("canViewSdkKey"); + openapiRequiredFields.add("canRotateSdkKey"); + openapiRequiredFields.add("canCreateOrUpdateSegments"); + openapiRequiredFields.add("canDeleteSegments"); + openapiRequiredFields.add("canViewProductAuditLog"); + openapiRequiredFields.add("canViewProductStatistics"); + openapiRequiredFields.add("canDisable2FA"); + openapiRequiredFields.add("accessType"); + openapiRequiredFields.add("newEnvironmentAccessType"); + openapiRequiredFields.add("environmentAccesses"); + openapiRequiredFields.add("product"); } /** @@ -888,36 +903,33 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in PermissionGroupModel is not found in the empty JSON string", PermissionGroupModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PermissionGroupModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + 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++) { - EnvironmentAccessModel.validateJsonElement(jsonArrayenvironmentAccesses.get(i)); - }; - } - } - // validate the optional field `product` - if (jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) { - ProductModel.validateJsonElement(jsonObj.get("product")); + // validate the required field `accessType` + AccessType.validateJsonElement(jsonObj.get("accessType")); + // validate the required field `newEnvironmentAccessType` + EnvironmentAccessType.validateJsonElement(jsonObj.get("newEnvironmentAccessType")); + // ensure the json data is an array + if (!jsonObj.get("environmentAccesses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `environmentAccesses` to be an array in the JSON string but got `%s`", jsonObj.get("environmentAccesses").toString())); } + + JsonArray jsonArrayenvironmentAccesses = jsonObj.getAsJsonArray("environmentAccesses"); + // validate the required field `environmentAccesses` (array) + for (int i = 0; i < jsonArrayenvironmentAccesses.size(); i++) { + EnvironmentAccessModel.validateJsonElement(jsonArrayenvironmentAccesses.get(i)); + }; + // validate the required field `product` + ProductModel.validateJsonElement(jsonObj.get("product")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 b56ab8f..d801481 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 @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -54,7 +53,7 @@ /** * PreferencesModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class PreferencesModel { public static final String SERIALIZED_NAME_REASON_REQUIRED = "reasonRequired"; @SerializedName(SERIALIZED_NAME_REASON_REQUIRED) @@ -88,7 +87,7 @@ public PreferencesModel reasonRequired(Boolean reasonRequired) { * Indicates that a mandatory note required for saving and publishing. * @return reasonRequired */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getReasonRequired() { return reasonRequired; } @@ -107,7 +106,7 @@ public PreferencesModel keyGenerationMode(KeyGenerationMode keyGenerationMode) { * Get keyGenerationMode * @return keyGenerationMode */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public KeyGenerationMode getKeyGenerationMode() { return keyGenerationMode; } @@ -126,7 +125,7 @@ public PreferencesModel showVariationId(Boolean showVariationId) { * Indicates whether a variation ID's must be shown on the ConfigCat Dashboard. * @return showVariationId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getShowVariationId() { return showVariationId; } @@ -172,7 +171,7 @@ public PreferencesModel mandatorySettingHint(Boolean mandatorySettingHint) { * Indicates whether Feature flags and Settings must have a hint. * @return mandatorySettingHint */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getMandatorySettingHint() { return mandatorySettingHint; } @@ -244,22 +243,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, preferencesModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(reasonRequired, keyGenerationMode, showVariationId, reasonRequiredEnvironments, mandatorySettingHint, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -300,6 +288,11 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("reasonRequired"); + openapiRequiredFields.add("keyGenerationMode"); + openapiRequiredFields.add("showVariationId"); + openapiRequiredFields.add("reasonRequiredEnvironments"); + openapiRequiredFields.add("mandatorySettingHint"); } /** @@ -314,25 +307,26 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in PreferencesModel is not found in the empty JSON string", PreferencesModel.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `keyGenerationMode` - if (jsonObj.get("keyGenerationMode") != null && !jsonObj.get("keyGenerationMode").isJsonNull()) { - KeyGenerationMode.validateJsonElement(jsonObj.get("keyGenerationMode")); - } - if (jsonObj.get("reasonRequiredEnvironments") != null && !jsonObj.get("reasonRequiredEnvironments").isJsonNull()) { - JsonArray jsonArrayreasonRequiredEnvironments = jsonObj.getAsJsonArray("reasonRequiredEnvironments"); - if (jsonArrayreasonRequiredEnvironments != null) { - // ensure the json data is an array - if (!jsonObj.get("reasonRequiredEnvironments").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `reasonRequiredEnvironments` to be an array in the JSON string but got `%s`", jsonObj.get("reasonRequiredEnvironments").toString())); - } - - // validate the optional field `reasonRequiredEnvironments` (array) - for (int i = 0; i < jsonArrayreasonRequiredEnvironments.size(); i++) { - ReasonRequiredEnvironmentModel.validateJsonElement(jsonArrayreasonRequiredEnvironments.get(i)); - }; + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PreferencesModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `keyGenerationMode` + KeyGenerationMode.validateJsonElement(jsonObj.get("keyGenerationMode")); + // ensure the json data is an array + if (!jsonObj.get("reasonRequiredEnvironments").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `reasonRequiredEnvironments` to be an array in the JSON string but got `%s`", jsonObj.get("reasonRequiredEnvironments").toString())); + } + + JsonArray jsonArrayreasonRequiredEnvironments = jsonObj.getAsJsonArray("reasonRequiredEnvironments"); + // validate the required field `reasonRequiredEnvironments` (array) + for (int i = 0; i < jsonArrayreasonRequiredEnvironments.size(); i++) { + ReasonRequiredEnvironmentModel.validateJsonElement(jsonArrayreasonRequiredEnvironments.get(i)); + }; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 f134e04..2bd81fe 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 @@ -51,7 +51,7 @@ /** * Describes a condition that is based on a prerequisite flag. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class PrerequisiteFlagConditionModel { public static final String SERIALIZED_NAME_PREREQUISITE_SETTING_ID = "prerequisiteSettingId"; @SerializedName(SERIALIZED_NAME_PREREQUISITE_SETTING_ID) 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 2d69f93..afeff83 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 @@ -23,7 +23,6 @@ import java.io.IOException; import java.util.Arrays; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -52,7 +51,7 @@ /** * Details of the Product. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class ProductModel { public static final String SERIALIZED_NAME_ORGANIZATION = "organization"; @SerializedName(SERIALIZED_NAME_ORGANIZATION) @@ -90,7 +89,7 @@ public ProductModel organization(OrganizationModel organization) { * Get organization * @return organization */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public OrganizationModel getOrganization() { return organization; } @@ -109,7 +108,7 @@ public ProductModel productId(UUID productId) { * Identifier of the Product. * @return productId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getProductId() { return productId; } @@ -128,7 +127,7 @@ public ProductModel name(String name) { * Name of the Product. * @return name */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getName() { return name; } @@ -163,10 +162,10 @@ public ProductModel order(Integer order) { } /** - * The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. + * The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. * @return order */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Integer getOrder() { return order; } @@ -185,7 +184,7 @@ public ProductModel reasonRequired(Boolean reasonRequired) { * 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 + @javax.annotation.Nonnull public Boolean getReasonRequired() { return reasonRequired; } @@ -258,22 +257,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, productModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(organization, productId, name, description, order, reasonRequired, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -316,6 +304,12 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("organization"); + openapiRequiredFields.add("productId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("order"); + openapiRequiredFields.add("reasonRequired"); } /** @@ -330,15 +324,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in ProductModel is not found in the empty JSON string", ProductModel.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `organization` - if (jsonObj.get("organization") != null && !jsonObj.get("organization").isJsonNull()) { - OrganizationModel.validateJsonElement(jsonObj.get("organization")); + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ProductModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } } - if ((jsonObj.get("productId") != null && !jsonObj.get("productId").isJsonNull()) && !jsonObj.get("productId").isJsonPrimitive()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `organization` + OrganizationModel.validateJsonElement(jsonObj.get("organization")); + if (!jsonObj.get("productId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `productId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productId").toString())); } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + 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()) { 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 77c15ec..db817cc 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 @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -51,7 +50,7 @@ /** * ReasonRequiredEnvironmentModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class ReasonRequiredEnvironmentModel { public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) @@ -77,7 +76,7 @@ public ReasonRequiredEnvironmentModel environmentId(UUID environmentId) { * Identifier of the Environment. * @return environmentId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getEnvironmentId() { return environmentId; } @@ -96,7 +95,7 @@ public ReasonRequiredEnvironmentModel reasonRequired(Boolean reasonRequired) { * Indicates that a mandatory note is required in this Environment for saving and publishing. * @return reasonRequired */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getReasonRequired() { return reasonRequired; } @@ -185,22 +184,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, reasonRequiredEnvironmentModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(environmentId, reasonRequired, environmentName, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -237,6 +225,9 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("environmentId"); + openapiRequiredFields.add("reasonRequired"); + openapiRequiredFields.add("environmentName"); } /** @@ -251,8 +242,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in ReasonRequiredEnvironmentModel is not found in the empty JSON string", ReasonRequiredEnvironmentModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReasonRequiredEnvironmentModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("environmentId") != null && !jsonObj.get("environmentId").isJsonNull()) && !jsonObj.get("environmentId").isJsonPrimitive()) { + if (!jsonObj.get("environmentId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); } if ((jsonObj.get("environmentName") != null && !jsonObj.get("environmentName").isJsonNull()) && !jsonObj.get("environmentName").isJsonPrimitive()) { diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLineModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLineModel.java new file mode 100644 index 0000000..2fbbd64 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLineModel.java @@ -0,0 +1,322 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Determines a code reference line. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ReferenceLineModel { + public static final String SERIALIZED_NAME_LINE_TEXT = "lineText"; + @SerializedName(SERIALIZED_NAME_LINE_TEXT) + private String lineText; + + public static final String SERIALIZED_NAME_LINE_NUMBER = "lineNumber"; + @SerializedName(SERIALIZED_NAME_LINE_NUMBER) + private Integer lineNumber; + + public ReferenceLineModel() { + } + + public ReferenceLineModel lineText(String lineText) { + this.lineText = lineText; + return this; + } + + /** + * The content of the reference line. + * @return lineText + */ + @javax.annotation.Nullable + public String getLineText() { + return lineText; + } + + public void setLineText(String lineText) { + this.lineText = lineText; + } + + + public ReferenceLineModel lineNumber(Integer lineNumber) { + this.lineNumber = lineNumber; + return this; + } + + /** + * The line number. + * @return lineNumber + */ + @javax.annotation.Nonnull + public Integer getLineNumber() { + return lineNumber; + } + + public void setLineNumber(Integer lineNumber) { + this.lineNumber = lineNumber; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ReferenceLineModel instance itself + */ + public ReferenceLineModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReferenceLineModel referenceLineModel = (ReferenceLineModel) o; + return Objects.equals(this.lineText, referenceLineModel.lineText) && + Objects.equals(this.lineNumber, referenceLineModel.lineNumber)&& + Objects.equals(this.additionalProperties, referenceLineModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(lineText, lineNumber, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReferenceLineModel {\n"); + sb.append(" lineText: ").append(toIndentedString(lineText)).append("\n"); + sb.append(" lineNumber: ").append(toIndentedString(lineNumber)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("lineText"); + openapiFields.add("lineNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("lineText"); + openapiRequiredFields.add("lineNumber"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ReferenceLineModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReferenceLineModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReferenceLineModel is not found in the empty JSON string", ReferenceLineModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReferenceLineModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("lineText") != null && !jsonObj.get("lineText").isJsonNull()) && !jsonObj.get("lineText").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lineText` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lineText").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReferenceLineModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReferenceLineModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReferenceLineModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReferenceLineModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ReferenceLineModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReferenceLineModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReferenceLineModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReferenceLineModel + * @throws IOException if the JSON string is invalid with respect to ReferenceLineModel + */ + public static ReferenceLineModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReferenceLineModel.class); + } + + /** + * Convert an instance of ReferenceLineModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLine.java b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLineRequest.java similarity index 85% rename from src/main/java/com/configcat/publicapi/java/client/model/ReferenceLine.java rename to src/main/java/com/configcat/publicapi/java/client/model/ReferenceLineRequest.java index 58be71a..243bec2 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLine.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLineRequest.java @@ -50,8 +50,8 @@ /** * Determines a code reference line. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ReferenceLine { +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ReferenceLineRequest { public static final String SERIALIZED_NAME_LINE_TEXT = "lineText"; @SerializedName(SERIALIZED_NAME_LINE_TEXT) private String lineText; @@ -60,10 +60,10 @@ public class ReferenceLine { @SerializedName(SERIALIZED_NAME_LINE_NUMBER) private Integer lineNumber; - public ReferenceLine() { + public ReferenceLineRequest() { } - public ReferenceLine lineText(String lineText) { + public ReferenceLineRequest lineText(String lineText) { this.lineText = lineText; return this; } @@ -82,7 +82,7 @@ public void setLineText(String lineText) { } - public ReferenceLine lineNumber(Integer lineNumber) { + public ReferenceLineRequest lineNumber(Integer lineNumber) { this.lineNumber = lineNumber; return this; } @@ -113,9 +113,9 @@ public void setLineNumber(Integer lineNumber) { * * @param key name of the property * @param value value of the property - * @return the ReferenceLine instance itself + * @return the ReferenceLineRequest instance itself */ - public ReferenceLine putAdditionalProperty(String key, Object value) { + public ReferenceLineRequest putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -154,10 +154,10 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ReferenceLine referenceLine = (ReferenceLine) o; - return Objects.equals(this.lineText, referenceLine.lineText) && - Objects.equals(this.lineNumber, referenceLine.lineNumber)&& - Objects.equals(this.additionalProperties, referenceLine.additionalProperties); + ReferenceLineRequest referenceLineRequest = (ReferenceLineRequest) o; + return Objects.equals(this.lineText, referenceLineRequest.lineText) && + Objects.equals(this.lineNumber, referenceLineRequest.lineNumber)&& + Objects.equals(this.additionalProperties, referenceLineRequest.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -179,7 +179,7 @@ private static int hashCodeNullable(JsonNullable a) { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ReferenceLine {\n"); + sb.append("class ReferenceLineRequest {\n"); sb.append(" lineText: ").append(toIndentedString(lineText)).append("\n"); sb.append(" lineNumber: ").append(toIndentedString(lineNumber)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -217,17 +217,17 @@ private String toIndentedString(Object o) { * Validates the 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 + * @throws IOException if the JSON Element is invalid with respect to ReferenceLineRequest */ 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())); + if (!ReferenceLineRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReferenceLineRequest is not found in the empty JSON string", ReferenceLineRequest.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ReferenceLine.openapiRequiredFields) { + for (String requiredField : ReferenceLineRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } @@ -242,16 +242,16 @@ 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 + if (!ReferenceLineRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReferenceLineRequest' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ReferenceLine.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReferenceLineRequest.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, ReferenceLine value) throws IOException { + public void write(JsonWriter out, ReferenceLineRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -279,12 +279,12 @@ else if (entry.getValue() instanceof Character) } @Override - public ReferenceLine read(JsonReader in) throws IOException { + public ReferenceLineRequest read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - ReferenceLine instance = thisAdapter.fromJsonTree(jsonObj); + ReferenceLineRequest instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -311,18 +311,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of ReferenceLine given an JSON string + * Create an instance of ReferenceLineRequest 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 + * @return An instance of ReferenceLineRequest + * @throws IOException if the JSON string is invalid with respect to ReferenceLineRequest */ - public static ReferenceLine fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReferenceLine.class); + public static ReferenceLineRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReferenceLineRequest.class); } /** - * Convert an instance of ReferenceLine to an JSON string + * Convert an instance of ReferenceLineRequest to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLinesModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLinesModel.java new file mode 100644 index 0000000..bc282b4 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLinesModel.java @@ -0,0 +1,447 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.ReferenceLineModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * ReferenceLinesModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ReferenceLinesModel { + public static final String SERIALIZED_NAME_FILE = "file"; + @SerializedName(SERIALIZED_NAME_FILE) + private String _file; + + public static final String SERIALIZED_NAME_FILE_URL = "fileUrl"; + @SerializedName(SERIALIZED_NAME_FILE_URL) + private String fileUrl; + + public static final String SERIALIZED_NAME_PRE_LINES = "preLines"; + @SerializedName(SERIALIZED_NAME_PRE_LINES) + private List preLines = new ArrayList<>(); + + public static final String SERIALIZED_NAME_POST_LINES = "postLines"; + @SerializedName(SERIALIZED_NAME_POST_LINES) + private List postLines = new ArrayList<>(); + + public static final String SERIALIZED_NAME_REFERENCE_LINE = "referenceLine"; + @SerializedName(SERIALIZED_NAME_REFERENCE_LINE) + private ReferenceLineModel referenceLine; + + public ReferenceLinesModel() { + } + + public ReferenceLinesModel _file(String _file) { + this._file = _file; + return this; + } + + /** + * The file's name in where the code reference has been found. (Appears on the ConfigCat Dashboard) + * @return _file + */ + @javax.annotation.Nonnull + public String getFile() { + return _file; + } + + public void setFile(String _file) { + this._file = _file; + } + + + public ReferenceLinesModel fileUrl(String fileUrl) { + this.fileUrl = fileUrl; + return this; + } + + /** + * The file's url. (Used to point to the file on the repository's website) + * @return fileUrl + */ + @javax.annotation.Nullable + public String getFileUrl() { + return fileUrl; + } + + public void setFileUrl(String fileUrl) { + this.fileUrl = fileUrl; + } + + + public ReferenceLinesModel preLines(List preLines) { + this.preLines = preLines; + return this; + } + + public ReferenceLinesModel addPreLinesItem(ReferenceLineModel preLinesItem) { + if (this.preLines == null) { + this.preLines = new ArrayList<>(); + } + this.preLines.add(preLinesItem); + return this; + } + + /** + * The lines before the actual reference line. + * @return preLines + */ + @javax.annotation.Nonnull + public List getPreLines() { + return preLines; + } + + public void setPreLines(List preLines) { + this.preLines = preLines; + } + + + public ReferenceLinesModel postLines(List postLines) { + this.postLines = postLines; + return this; + } + + public ReferenceLinesModel addPostLinesItem(ReferenceLineModel postLinesItem) { + if (this.postLines == null) { + this.postLines = new ArrayList<>(); + } + this.postLines.add(postLinesItem); + return this; + } + + /** + * The lines after the actual reference line. + * @return postLines + */ + @javax.annotation.Nonnull + public List getPostLines() { + return postLines; + } + + public void setPostLines(List postLines) { + this.postLines = postLines; + } + + + public ReferenceLinesModel referenceLine(ReferenceLineModel referenceLine) { + this.referenceLine = referenceLine; + return this; + } + + /** + * Get referenceLine + * @return referenceLine + */ + @javax.annotation.Nonnull + public ReferenceLineModel getReferenceLine() { + return referenceLine; + } + + public void setReferenceLine(ReferenceLineModel referenceLine) { + this.referenceLine = referenceLine; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ReferenceLinesModel instance itself + */ + public ReferenceLinesModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReferenceLinesModel referenceLinesModel = (ReferenceLinesModel) o; + return Objects.equals(this._file, referenceLinesModel._file) && + Objects.equals(this.fileUrl, referenceLinesModel.fileUrl) && + Objects.equals(this.preLines, referenceLinesModel.preLines) && + Objects.equals(this.postLines, referenceLinesModel.postLines) && + Objects.equals(this.referenceLine, referenceLinesModel.referenceLine)&& + Objects.equals(this.additionalProperties, referenceLinesModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(_file, fileUrl, preLines, postLines, referenceLine, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReferenceLinesModel {\n"); + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" fileUrl: ").append(toIndentedString(fileUrl)).append("\n"); + sb.append(" preLines: ").append(toIndentedString(preLines)).append("\n"); + sb.append(" postLines: ").append(toIndentedString(postLines)).append("\n"); + sb.append(" referenceLine: ").append(toIndentedString(referenceLine)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("file"); + openapiFields.add("fileUrl"); + openapiFields.add("preLines"); + openapiFields.add("postLines"); + openapiFields.add("referenceLine"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("file"); + openapiRequiredFields.add("fileUrl"); + openapiRequiredFields.add("preLines"); + openapiRequiredFields.add("postLines"); + openapiRequiredFields.add("referenceLine"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ReferenceLinesModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReferenceLinesModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReferenceLinesModel is not found in the empty JSON string", ReferenceLinesModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReferenceLinesModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("file").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `file` to be a primitive type in the JSON string but got `%s`", jsonObj.get("file").toString())); + } + if ((jsonObj.get("fileUrl") != null && !jsonObj.get("fileUrl").isJsonNull()) && !jsonObj.get("fileUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fileUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fileUrl").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("preLines").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `preLines` to be an array in the JSON string but got `%s`", jsonObj.get("preLines").toString())); + } + + JsonArray jsonArraypreLines = jsonObj.getAsJsonArray("preLines"); + // validate the required field `preLines` (array) + for (int i = 0; i < jsonArraypreLines.size(); i++) { + ReferenceLineModel.validateJsonElement(jsonArraypreLines.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("postLines").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `postLines` to be an array in the JSON string but got `%s`", jsonObj.get("postLines").toString())); + } + + JsonArray jsonArraypostLines = jsonObj.getAsJsonArray("postLines"); + // validate the required field `postLines` (array) + for (int i = 0; i < jsonArraypostLines.size(); i++) { + ReferenceLineModel.validateJsonElement(jsonArraypostLines.get(i)); + }; + // validate the required field `referenceLine` + ReferenceLineModel.validateJsonElement(jsonObj.get("referenceLine")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReferenceLinesModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReferenceLinesModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReferenceLinesModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReferenceLinesModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ReferenceLinesModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReferenceLinesModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReferenceLinesModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReferenceLinesModel + * @throws IOException if the JSON string is invalid with respect to ReferenceLinesModel + */ + public static ReferenceLinesModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReferenceLinesModel.class); + } + + /** + * Convert an instance of ReferenceLinesModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLines.java b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLinesRequest.java similarity index 81% rename from src/main/java/com/configcat/publicapi/java/client/model/ReferenceLines.java rename to src/main/java/com/configcat/publicapi/java/client/model/ReferenceLinesRequest.java index c1f1458..a92450e 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLines.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLinesRequest.java @@ -14,7 +14,7 @@ package com.configcat.publicapi.java.client.model; import java.util.Objects; -import com.configcat.publicapi.java.client.model.ReferenceLine; +import com.configcat.publicapi.java.client.model.ReferenceLineRequest; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -51,10 +51,10 @@ import com.configcat.publicapi.java.client.JSON; /** - * ReferenceLines + * ReferenceLinesRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ReferenceLines { +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ReferenceLinesRequest { public static final String SERIALIZED_NAME_FILE = "file"; @SerializedName(SERIALIZED_NAME_FILE) private String _file; @@ -65,20 +65,20 @@ public class ReferenceLines { public static final String SERIALIZED_NAME_PRE_LINES = "preLines"; @SerializedName(SERIALIZED_NAME_PRE_LINES) - private List preLines; + private List preLines = new ArrayList<>(); public static final String SERIALIZED_NAME_POST_LINES = "postLines"; @SerializedName(SERIALIZED_NAME_POST_LINES) - private List postLines; + private List postLines = new ArrayList<>(); public static final String SERIALIZED_NAME_REFERENCE_LINE = "referenceLine"; @SerializedName(SERIALIZED_NAME_REFERENCE_LINE) - private ReferenceLine referenceLine; + private ReferenceLineRequest referenceLine; - public ReferenceLines() { + public ReferenceLinesRequest() { } - public ReferenceLines _file(String _file) { + public ReferenceLinesRequest _file(String _file) { this._file = _file; return this; } @@ -97,7 +97,7 @@ public void setFile(String _file) { } - public ReferenceLines fileUrl(String fileUrl) { + public ReferenceLinesRequest fileUrl(String fileUrl) { this.fileUrl = fileUrl; return this; } @@ -116,12 +116,12 @@ public void setFileUrl(String fileUrl) { } - public ReferenceLines preLines(List preLines) { + public ReferenceLinesRequest preLines(List preLines) { this.preLines = preLines; return this; } - public ReferenceLines addPreLinesItem(ReferenceLine preLinesItem) { + public ReferenceLinesRequest addPreLinesItem(ReferenceLineRequest preLinesItem) { if (this.preLines == null) { this.preLines = new ArrayList<>(); } @@ -134,21 +134,21 @@ public ReferenceLines addPreLinesItem(ReferenceLine preLinesItem) { * @return preLines */ @javax.annotation.Nullable - public List getPreLines() { + public List getPreLines() { return preLines; } - public void setPreLines(List preLines) { + public void setPreLines(List preLines) { this.preLines = preLines; } - public ReferenceLines postLines(List postLines) { + public ReferenceLinesRequest postLines(List postLines) { this.postLines = postLines; return this; } - public ReferenceLines addPostLinesItem(ReferenceLine postLinesItem) { + public ReferenceLinesRequest addPostLinesItem(ReferenceLineRequest postLinesItem) { if (this.postLines == null) { this.postLines = new ArrayList<>(); } @@ -161,16 +161,16 @@ public ReferenceLines addPostLinesItem(ReferenceLine postLinesItem) { * @return postLines */ @javax.annotation.Nullable - public List getPostLines() { + public List getPostLines() { return postLines; } - public void setPostLines(List postLines) { + public void setPostLines(List postLines) { this.postLines = postLines; } - public ReferenceLines referenceLine(ReferenceLine referenceLine) { + public ReferenceLinesRequest referenceLine(ReferenceLineRequest referenceLine) { this.referenceLine = referenceLine; return this; } @@ -180,11 +180,11 @@ public ReferenceLines referenceLine(ReferenceLine referenceLine) { * @return referenceLine */ @javax.annotation.Nonnull - public ReferenceLine getReferenceLine() { + public ReferenceLineRequest getReferenceLine() { return referenceLine; } - public void setReferenceLine(ReferenceLine referenceLine) { + public void setReferenceLine(ReferenceLineRequest referenceLine) { this.referenceLine = referenceLine; } @@ -201,9 +201,9 @@ public void setReferenceLine(ReferenceLine referenceLine) { * * @param key name of the property * @param value value of the property - * @return the ReferenceLines instance itself + * @return the ReferenceLinesRequest instance itself */ - public ReferenceLines putAdditionalProperty(String key, Object value) { + public ReferenceLinesRequest putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -242,13 +242,13 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ReferenceLines referenceLines = (ReferenceLines) o; - return Objects.equals(this._file, referenceLines._file) && - Objects.equals(this.fileUrl, referenceLines.fileUrl) && - Objects.equals(this.preLines, referenceLines.preLines) && - Objects.equals(this.postLines, referenceLines.postLines) && - Objects.equals(this.referenceLine, referenceLines.referenceLine)&& - Objects.equals(this.additionalProperties, referenceLines.additionalProperties); + ReferenceLinesRequest referenceLinesRequest = (ReferenceLinesRequest) o; + return Objects.equals(this._file, referenceLinesRequest._file) && + Objects.equals(this.fileUrl, referenceLinesRequest.fileUrl) && + Objects.equals(this.preLines, referenceLinesRequest.preLines) && + Objects.equals(this.postLines, referenceLinesRequest.postLines) && + Objects.equals(this.referenceLine, referenceLinesRequest.referenceLine)&& + Objects.equals(this.additionalProperties, referenceLinesRequest.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -270,7 +270,7 @@ private static int hashCodeNullable(JsonNullable a) { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ReferenceLines {\n"); + sb.append("class ReferenceLinesRequest {\n"); sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); sb.append(" fileUrl: ").append(toIndentedString(fileUrl)).append("\n"); sb.append(" preLines: ").append(toIndentedString(preLines)).append("\n"); @@ -315,17 +315,17 @@ private String toIndentedString(Object o) { * Validates the 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 + * @throws IOException if the JSON Element is invalid with respect to ReferenceLinesRequest */ 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())); + if (!ReferenceLinesRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReferenceLinesRequest is not found in the empty JSON string", ReferenceLinesRequest.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ReferenceLines.openapiRequiredFields) { + for (String requiredField : ReferenceLinesRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } @@ -347,7 +347,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `preLines` (array) for (int i = 0; i < jsonArraypreLines.size(); i++) { - ReferenceLine.validateJsonElement(jsonArraypreLines.get(i)); + ReferenceLineRequest.validateJsonElement(jsonArraypreLines.get(i)); }; } } @@ -361,28 +361,28 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `postLines` (array) for (int i = 0; i < jsonArraypostLines.size(); i++) { - ReferenceLine.validateJsonElement(jsonArraypostLines.get(i)); + ReferenceLineRequest.validateJsonElement(jsonArraypostLines.get(i)); }; } } // validate the required field `referenceLine` - ReferenceLine.validateJsonElement(jsonObj.get("referenceLine")); + ReferenceLineRequest.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 + if (!ReferenceLinesRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReferenceLinesRequest' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ReferenceLines.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReferenceLinesRequest.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, ReferenceLines value) throws IOException { + public void write(JsonWriter out, ReferenceLinesRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -410,12 +410,12 @@ else if (entry.getValue() instanceof Character) } @Override - public ReferenceLines read(JsonReader in) throws IOException { + public ReferenceLinesRequest read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - ReferenceLines instance = thisAdapter.fromJsonTree(jsonObj); + ReferenceLinesRequest instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -442,18 +442,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of ReferenceLines given an JSON string + * Create an instance of ReferenceLinesRequest 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 + * @return An instance of ReferenceLinesRequest + * @throws IOException if the JSON string is invalid with respect to ReferenceLinesRequest */ - public static ReferenceLines fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReferenceLines.class); + public static ReferenceLinesRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReferenceLinesRequest.class); } /** - * Convert an instance of ReferenceLines to an JSON string + * Convert an instance of ReferenceLinesRequest to an JSON string * * @return JSON string */ 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 5aea8be..1ce949d 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 @@ -52,7 +52,7 @@ /** * ReplaceSettingModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class ReplaceSettingModel { public static final String SERIALIZED_NAME_HINT = "hint"; @SerializedName(SERIALIZED_NAME_HINT) @@ -125,7 +125,7 @@ public ReplaceSettingModel order(Integer order) { } /** - * The order of the Setting represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. + * The order of the Setting represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. * @return order */ @javax.annotation.Nullable @@ -147,7 +147,7 @@ public ReplaceSettingModel name(String name) { * The name of the Feature Flag or Setting. * @return name */ - @javax.annotation.Nonnull + @javax.annotation.Nullable public String getName() { return name; } @@ -272,7 +272,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); } /** @@ -287,13 +286,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in ReplaceSettingModel is not found in the empty JSON string", ReplaceSettingModel.openapiRequiredFields.toString())); } } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ReplaceSettingModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("hint") != null && !jsonObj.get("hint").isJsonNull()) && !jsonObj.get("hint").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); @@ -302,7 +294,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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()) { + 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())); } } 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 609c4fe..bce1308 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 @@ -14,6 +14,7 @@ package com.configcat.publicapi.java.client.model; import java.util.Objects; +import com.configcat.publicapi.java.client.model.SettingValueType; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -21,7 +22,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -50,7 +50,7 @@ /** * RolloutPercentageItemModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class RolloutPercentageItemModel { public static final String SERIALIZED_NAME_PERCENTAGE = "percentage"; @SerializedName(SERIALIZED_NAME_PERCENTAGE) @@ -58,7 +58,7 @@ public class RolloutPercentageItemModel { public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) - private Object value = null; + private SettingValueType value; public RolloutPercentageItemModel() { } @@ -82,21 +82,21 @@ public void setPercentage(Long percentage) { } - public RolloutPercentageItemModel value(Object value) { + public RolloutPercentageItemModel value(SettingValueType value) { this.value = value; return this; } /** - * The value to serve when the user falls in the percentage rule. It must respect the setting type. + * The value to serve when the user falls in the percentage rule. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. * @return value */ - @javax.annotation.Nullable - public Object getValue() { + @javax.annotation.Nonnull + public SettingValueType getValue() { return value; } - public void setValue(Object value) { + public void setValue(SettingValueType value) { this.value = value; } @@ -160,22 +160,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, rolloutPercentageItemModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(percentage, value, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -211,6 +200,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("percentage"); + openapiRequiredFields.add("value"); } /** @@ -233,6 +223,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `value` + SettingValueType.validateJsonElement(jsonObj.get("value")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 c56ac7c..fa42676 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 @@ -16,6 +16,7 @@ import java.util.Objects; import com.configcat.publicapi.java.client.model.RolloutRuleComparator; import com.configcat.publicapi.java.client.model.SegmentComparator; +import com.configcat.publicapi.java.client.model.SettingValueType; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -24,7 +25,6 @@ import java.io.IOException; import java.util.Arrays; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -53,7 +53,7 @@ /** * RolloutRuleModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class RolloutRuleModel { public static final String SERIALIZED_NAME_COMPARISON_ATTRIBUTE = "comparisonAttribute"; @SerializedName(SERIALIZED_NAME_COMPARISON_ATTRIBUTE) @@ -69,7 +69,7 @@ public class RolloutRuleModel { public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) - private Object value = null; + private SettingValueType value; public static final String SERIALIZED_NAME_SEGMENT_COMPARATOR = "segmentComparator"; @SerializedName(SERIALIZED_NAME_SEGMENT_COMPARATOR) @@ -139,21 +139,21 @@ public void setComparisonValue(String comparisonValue) { } - public RolloutRuleModel value(Object value) { + public RolloutRuleModel value(SettingValueType value) { this.value = value; return this; } /** - * The value to serve when the comparison matches. It must respect the setting type. + * The value to serve when the comparison matches. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. * @return value */ - @javax.annotation.Nullable - public Object getValue() { + @javax.annotation.Nonnull + public SettingValueType getValue() { return value; } - public void setValue(Object value) { + public void setValue(SettingValueType value) { this.value = value; } @@ -259,22 +259,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, rolloutRuleModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(comparisonAttribute, comparator, comparisonValue, value, segmentComparator, segmentId, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -317,6 +306,12 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("comparisonAttribute"); + openapiRequiredFields.add("comparator"); + openapiRequiredFields.add("comparisonValue"); + openapiRequiredFields.add("value"); + openapiRequiredFields.add("segmentComparator"); + openapiRequiredFields.add("segmentId"); } /** @@ -331,21 +326,26 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in RolloutRuleModel is not found in the empty JSON string", RolloutRuleModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RolloutRuleModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("comparisonAttribute") != null && !jsonObj.get("comparisonAttribute").isJsonNull()) && !jsonObj.get("comparisonAttribute").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `comparisonAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonAttribute").toString())); } - // validate the optional field `comparator` - if (jsonObj.get("comparator") != null && !jsonObj.get("comparator").isJsonNull()) { - RolloutRuleComparator.validateJsonElement(jsonObj.get("comparator")); - } + // validate the required field `comparator` + RolloutRuleComparator.validateJsonElement(jsonObj.get("comparator")); if ((jsonObj.get("comparisonValue") != null && !jsonObj.get("comparisonValue").isJsonNull()) && !jsonObj.get("comparisonValue").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `comparisonValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonValue").toString())); } - // validate the optional field `segmentComparator` - if (jsonObj.get("segmentComparator") != null && !jsonObj.get("segmentComparator").isJsonNull()) { - SegmentComparator.validateJsonElement(jsonObj.get("segmentComparator")); - } + // validate the required field `value` + SettingValueType.validateJsonElement(jsonObj.get("value")); + // validate the required field `segmentComparator` + SegmentComparator.validateJsonElement(jsonObj.get("segmentComparator")); if ((jsonObj.get("segmentId") != null && !jsonObj.get("segmentId").isJsonNull()) && !jsonObj.get("segmentId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `segmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("segmentId").toString())); } 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 86cb5f2..4f367bc 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 @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -50,7 +49,7 @@ /** * SdkKeysModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class SdkKeysModel { public static final String SERIALIZED_NAME_PRIMARY = "primary"; @SerializedName(SERIALIZED_NAME_PRIMARY) @@ -72,7 +71,7 @@ public SdkKeysModel primary(String primary) { * The primary SDK key. * @return primary */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getPrimary() { return primary; } @@ -160,22 +159,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, sdkKeysModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(primary, secondary, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -210,6 +198,8 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("primary"); + openapiRequiredFields.add("secondary"); } /** @@ -224,8 +214,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in SdkKeysModel is not found in the empty JSON string", SdkKeysModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SdkKeysModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("primary") != null && !jsonObj.get("primary").isJsonNull()) && !jsonObj.get("primary").isJsonPrimitive()) { + if (!jsonObj.get("primary").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `primary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("primary").toString())); } if ((jsonObj.get("secondary") != null && !jsonObj.get("secondary").isJsonNull()) && !jsonObj.get("secondary").isJsonPrimitive()) { 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 6018f51..a83f868 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 @@ -51,7 +51,7 @@ /** * Describes a condition that is based on a segment. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class SegmentConditionModel { public static final String SERIALIZED_NAME_SEGMENT_ID = "segmentId"; @SerializedName(SERIALIZED_NAME_SEGMENT_ID) 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 f417c76..c46bbfb 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 @@ -24,7 +24,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -53,7 +52,7 @@ /** * SegmentListModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class SegmentListModel { public static final String SERIALIZED_NAME_PRODUCT = "product"; @SerializedName(SERIALIZED_NAME_PRODUCT) @@ -111,7 +110,7 @@ public SegmentListModel product(ProductModel product) { * Get product * @return product */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public ProductModel getProduct() { return product; } @@ -130,7 +129,7 @@ public SegmentListModel segmentId(UUID segmentId) { * Identifier of the Segment. * @return segmentId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getSegmentId() { return segmentId; } @@ -149,7 +148,7 @@ public SegmentListModel name(String name) { * Name of the Segment. * @return name */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getName() { return name; } @@ -225,7 +224,7 @@ public SegmentListModel createdAt(OffsetDateTime createdAt) { * The date and time when the Segment was created. * @return createdAt */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public OffsetDateTime getCreatedAt() { return createdAt; } @@ -282,7 +281,7 @@ public SegmentListModel updatedAt(OffsetDateTime updatedAt) { * The date and time when the Segment was last updated. * @return updatedAt */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public OffsetDateTime getUpdatedAt() { return updatedAt; } @@ -301,7 +300,7 @@ public SegmentListModel usage(Integer usage) { * Determines how many Feature Flags and Settings are using the Segment. * @return usage */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Integer getUsage() { return usage; } @@ -379,22 +378,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, segmentListModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(product, segmentId, name, description, creatorEmail, creatorFullName, createdAt, lastUpdaterEmail, lastUpdaterFullName, updatedAt, usage, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -447,6 +435,17 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("product"); + openapiRequiredFields.add("segmentId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("creatorEmail"); + openapiRequiredFields.add("creatorFullName"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("lastUpdaterEmail"); + openapiRequiredFields.add("lastUpdaterFullName"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("usage"); } /** @@ -461,15 +460,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in SegmentListModel is not found in the empty JSON string", SegmentListModel.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `product` - if (jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) { - ProductModel.validateJsonElement(jsonObj.get("product")); + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SegmentListModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } } - if ((jsonObj.get("segmentId") != null && !jsonObj.get("segmentId").isJsonNull()) && !jsonObj.get("segmentId").isJsonPrimitive()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `product` + ProductModel.validateJsonElement(jsonObj.get("product")); + if (!jsonObj.get("segmentId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `segmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("segmentId").toString())); } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + 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()) { 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 a9d1ec6..9a7c0f6 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 @@ -25,7 +25,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -54,7 +53,7 @@ /** * SegmentModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class SegmentModel { public static final String SERIALIZED_NAME_PRODUCT = "product"; @SerializedName(SERIALIZED_NAME_PRODUCT) @@ -120,7 +119,7 @@ public SegmentModel product(ProductModel product) { * Get product * @return product */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public ProductModel getProduct() { return product; } @@ -139,7 +138,7 @@ public SegmentModel segmentId(UUID segmentId) { * Identifier of the Segment. * @return segmentId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getSegmentId() { return segmentId; } @@ -158,7 +157,7 @@ public SegmentModel name(String name) { * Name of the Segment. * @return name */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getName() { return name; } @@ -234,7 +233,7 @@ public SegmentModel createdAt(OffsetDateTime createdAt) { * The date and time when the Segment was created. * @return createdAt */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public OffsetDateTime getCreatedAt() { return createdAt; } @@ -291,7 +290,7 @@ public SegmentModel updatedAt(OffsetDateTime updatedAt) { * The date and time when the Segment was last updated. * @return updatedAt */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public OffsetDateTime getUpdatedAt() { return updatedAt; } @@ -310,7 +309,7 @@ public SegmentModel comparisonAttribute(String comparisonAttribute) { * The user's attribute the evaluation process must take into account. * @return comparisonAttribute */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getComparisonAttribute() { return comparisonAttribute; } @@ -329,7 +328,7 @@ public SegmentModel comparator(RolloutRuleComparator comparator) { * Get comparator * @return comparator */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public RolloutRuleComparator getComparator() { return comparator; } @@ -348,7 +347,7 @@ public SegmentModel comparisonValue(String comparisonValue) { * The value to compare with the given user attribute's value. * @return comparisonValue */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getComparisonValue() { return comparisonValue; } @@ -428,22 +427,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, segmentModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(product, segmentId, name, description, creatorEmail, creatorFullName, createdAt, lastUpdaterEmail, lastUpdaterFullName, updatedAt, comparisonAttribute, comparator, comparisonValue, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -500,6 +488,19 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("product"); + openapiRequiredFields.add("segmentId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("creatorEmail"); + openapiRequiredFields.add("creatorFullName"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("lastUpdaterEmail"); + openapiRequiredFields.add("lastUpdaterFullName"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("comparisonAttribute"); + openapiRequiredFields.add("comparator"); + openapiRequiredFields.add("comparisonValue"); } /** @@ -514,15 +515,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in SegmentModel is not found in the empty JSON string", SegmentModel.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `product` - if (jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) { - ProductModel.validateJsonElement(jsonObj.get("product")); + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SegmentModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } } - if ((jsonObj.get("segmentId") != null && !jsonObj.get("segmentId").isJsonNull()) && !jsonObj.get("segmentId").isJsonPrimitive()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `product` + ProductModel.validateJsonElement(jsonObj.get("product")); + if (!jsonObj.get("segmentId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `segmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("segmentId").toString())); } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + 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()) { @@ -540,14 +546,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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()) { + 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 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()) { + // 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())); } } 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 e0673a7..fd19535 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 @@ -23,7 +23,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -52,7 +51,7 @@ /** * Metadata of a Feature Flag or Setting. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class SettingDataModel { public static final String SERIALIZED_NAME_SETTING_ID = "settingId"; @SerializedName(SERIALIZED_NAME_SETTING_ID) @@ -106,7 +105,7 @@ public SettingDataModel settingId(Integer settingId) { * Identifier of the Feature Flag or Setting. * @return settingId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Integer getSettingId() { return settingId; } @@ -125,7 +124,7 @@ public SettingDataModel key(String key) { * Key of the Feature Flag or Setting. * @return key */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getKey() { return key; } @@ -144,7 +143,7 @@ public SettingDataModel name(String name) { * Name of the Feature Flag or Setting. * @return name */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getName() { return name; } @@ -182,7 +181,7 @@ public SettingDataModel settingType(SettingType settingType) { * Get settingType * @return settingType */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public SettingType getSettingType() { return settingType; } @@ -201,7 +200,7 @@ public SettingDataModel order(Integer order) { * The order of the Feature Flag or Setting represented on the ConfigCat Dashboard. * @return order */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Integer getOrder() { return order; } @@ -277,7 +276,7 @@ public SettingDataModel isWatching(Boolean isWatching) { * Get isWatching * @return isWatching */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getIsWatching() { return isWatching; } @@ -354,22 +353,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, settingDataModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(settingId, key, name, hint, settingType, order, createdAt, creatorEmail, creatorFullName, isWatching, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -420,6 +408,16 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("settingId"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("hint"); + openapiRequiredFields.add("settingType"); + openapiRequiredFields.add("order"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("creatorEmail"); + openapiRequiredFields.add("creatorFullName"); + openapiRequiredFields.add("isWatching"); } /** @@ -434,20 +432,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in SettingDataModel is not found in the empty JSON string", SettingDataModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SettingDataModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("key") != null && !jsonObj.get("key").isJsonNull()) && !jsonObj.get("key").isJsonPrimitive()) { + 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") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } if ((jsonObj.get("hint") != null && !jsonObj.get("hint").isJsonNull()) && !jsonObj.get("hint").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); } - // validate the optional field `settingType` - if (jsonObj.get("settingType") != null && !jsonObj.get("settingType").isJsonNull()) { - SettingType.validateJsonElement(jsonObj.get("settingType")); - } + // validate the required field `settingType` + SettingType.validateJsonElement(jsonObj.get("settingType")); if ((jsonObj.get("creatorEmail") != null && !jsonObj.get("creatorEmail").isJsonNull()) && !jsonObj.get("creatorEmail").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `creatorEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creatorEmail").toString())); } 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 6d7d3d9..1d0f866 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 @@ -33,7 +33,6 @@ import java.util.Arrays; import java.util.List; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -62,7 +61,7 @@ /** * SettingFormulaModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class SettingFormulaModel { public static final String SERIALIZED_NAME_LAST_VERSION_ID = "lastVersionId"; @SerializedName(SERIALIZED_NAME_LAST_VERSION_ID) @@ -74,7 +73,7 @@ public class SettingFormulaModel { public static final String SERIALIZED_NAME_TARGETING_RULES = "targetingRules"; @SerializedName(SERIALIZED_NAME_TARGETING_RULES) - private List targetingRules; + private List targetingRules = new ArrayList<>(); public static final String SERIALIZED_NAME_SETTING = "setting"; @SerializedName(SERIALIZED_NAME_SETTING) @@ -98,15 +97,15 @@ public class SettingFormulaModel { public static final String SERIALIZED_NAME_INTEGRATION_LINKS = "integrationLinks"; @SerializedName(SERIALIZED_NAME_INTEGRATION_LINKS) - private List integrationLinks; + private List integrationLinks = new ArrayList<>(); public static final String SERIALIZED_NAME_SETTING_TAGS = "settingTags"; @SerializedName(SERIALIZED_NAME_SETTING_TAGS) - private List settingTags; + private List settingTags = new ArrayList<>(); public static final String SERIALIZED_NAME_SETTING_IDS_WHERE_PREREQUISITE = "settingIdsWherePrerequisite"; @SerializedName(SERIALIZED_NAME_SETTING_IDS_WHERE_PREREQUISITE) - private List settingIdsWherePrerequisite; + private List settingIdsWherePrerequisite = new ArrayList<>(); public static final String SERIALIZED_NAME_CONFIG = "config"; @SerializedName(SERIALIZED_NAME_CONFIG) @@ -136,7 +135,7 @@ public SettingFormulaModel lastVersionId(UUID lastVersionId) { * Get lastVersionId * @return lastVersionId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getLastVersionId() { return lastVersionId; } @@ -155,7 +154,7 @@ public SettingFormulaModel defaultValue(ValueModel defaultValue) { * Get defaultValue * @return defaultValue */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public ValueModel getDefaultValue() { return defaultValue; } @@ -182,7 +181,7 @@ public SettingFormulaModel addTargetingRulesItem(TargetingRuleModel targetingRul * The targeting rules of the Feature Flag or Setting. * @return targetingRules */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getTargetingRules() { return targetingRules; } @@ -201,7 +200,7 @@ public SettingFormulaModel setting(SettingDataModel setting) { * Get setting * @return setting */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public SettingDataModel getSetting() { return setting; } @@ -304,7 +303,7 @@ public SettingFormulaModel addIntegrationLinksItem(IntegrationLinkModel integrat * The integration links attached to the Feature Flag or Setting. * @return integrationLinks */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getIntegrationLinks() { return integrationLinks; } @@ -331,7 +330,7 @@ public SettingFormulaModel addSettingTagsItem(SettingTagModel settingTagsItem) { * The tags attached to the Feature Flag or Setting. * @return settingTags */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getSettingTags() { return settingTags; } @@ -358,7 +357,7 @@ public SettingFormulaModel addSettingIdsWherePrerequisiteItem(Integer settingIds * List of Feature Flag and Setting IDs where the actual Feature Flag or Setting is prerequisite. * @return settingIdsWherePrerequisite */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getSettingIdsWherePrerequisite() { return settingIdsWherePrerequisite; } @@ -377,7 +376,7 @@ public SettingFormulaModel config(ConfigModel config) { * Get config * @return config */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public ConfigModel getConfig() { return config; } @@ -396,7 +395,7 @@ public SettingFormulaModel environment(EnvironmentModel environment) { * Get environment * @return environment */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public EnvironmentModel getEnvironment() { return environment; } @@ -415,7 +414,7 @@ public SettingFormulaModel readOnly(Boolean readOnly) { * Get readOnly * @return readOnly */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getReadOnly() { return readOnly; } @@ -434,7 +433,7 @@ public SettingFormulaModel featureFlagLimitations(FeatureFlagLimitations feature * Get featureFlagLimitations * @return featureFlagLimitations */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public FeatureFlagLimitations getFeatureFlagLimitations() { return featureFlagLimitations; } @@ -516,22 +515,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, settingFormulaModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(lastVersionId, defaultValue, targetingRules, setting, updatedAt, percentageEvaluationAttribute, lastUpdaterUserEmail, lastUpdaterUserFullName, integrationLinks, settingTags, settingIdsWherePrerequisite, config, environment, readOnly, featureFlagLimitations, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -592,6 +580,21 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("lastVersionId"); + openapiRequiredFields.add("defaultValue"); + openapiRequiredFields.add("targetingRules"); + openapiRequiredFields.add("setting"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("percentageEvaluationAttribute"); + openapiRequiredFields.add("lastUpdaterUserEmail"); + openapiRequiredFields.add("lastUpdaterUserFullName"); + openapiRequiredFields.add("integrationLinks"); + openapiRequiredFields.add("settingTags"); + openapiRequiredFields.add("settingIdsWherePrerequisite"); + openapiRequiredFields.add("config"); + openapiRequiredFields.add("environment"); + openapiRequiredFields.add("readOnly"); + openapiRequiredFields.add("featureFlagLimitations"); } /** @@ -606,32 +609,31 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in SettingFormulaModel is not found in the empty JSON string", SettingFormulaModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SettingFormulaModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("lastVersionId") != null && !jsonObj.get("lastVersionId").isJsonNull()) && !jsonObj.get("lastVersionId").isJsonPrimitive()) { + if (!jsonObj.get("lastVersionId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `lastVersionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastVersionId").toString())); } - // validate the 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")); + // validate the required field `defaultValue` + ValueModel.validateJsonElement(jsonObj.get("defaultValue")); + // ensure the json data is an array + if (!jsonObj.get("targetingRules").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `targetingRules` to be an array in the JSON string but got `%s`", jsonObj.get("targetingRules").toString())); } + + JsonArray jsonArraytargetingRules = jsonObj.getAsJsonArray("targetingRules"); + // validate the required field `targetingRules` (array) + for (int i = 0; i < jsonArraytargetingRules.size(); i++) { + TargetingRuleModel.validateJsonElement(jsonArraytargetingRules.get(i)); + }; + // validate the required field `setting` + SettingDataModel.validateJsonElement(jsonObj.get("setting")); if ((jsonObj.get("percentageEvaluationAttribute") != null && !jsonObj.get("percentageEvaluationAttribute").isJsonNull()) && !jsonObj.get("percentageEvaluationAttribute").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `percentageEvaluationAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("percentageEvaluationAttribute").toString())); } @@ -641,50 +643,38 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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)); - }; - } + // 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())); } - 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)); - }; - } + + JsonArray jsonArrayintegrationLinks = jsonObj.getAsJsonArray("integrationLinks"); + // validate the required field `integrationLinks` (array) + for (int i = 0; i < jsonArrayintegrationLinks.size(); i++) { + IntegrationLinkModel.validateJsonElement(jsonArrayintegrationLinks.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("settingTags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settingTags` to be an array in the JSON string but got `%s`", jsonObj.get("settingTags").toString())); } - // ensure the optional json data is an array if present - if (jsonObj.get("settingIdsWherePrerequisite") != null && !jsonObj.get("settingIdsWherePrerequisite").isJsonNull() && !jsonObj.get("settingIdsWherePrerequisite").isJsonArray()) { + + JsonArray jsonArraysettingTags = jsonObj.getAsJsonArray("settingTags"); + // validate the required field `settingTags` (array) + for (int i = 0; i < jsonArraysettingTags.size(); i++) { + SettingTagModel.validateJsonElement(jsonArraysettingTags.get(i)); + }; + // ensure the required json array is present + if (jsonObj.get("settingIdsWherePrerequisite") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("settingIdsWherePrerequisite").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `settingIdsWherePrerequisite` to be an array in the JSON string but got `%s`", jsonObj.get("settingIdsWherePrerequisite").toString())); } - // validate the 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")); - } + // validate the required field `config` + ConfigModel.validateJsonElement(jsonObj.get("config")); + // validate the required field `environment` + EnvironmentModel.validateJsonElement(jsonObj.get("environment")); + // validate the required field `featureFlagLimitations` + FeatureFlagLimitations.validateJsonElement(jsonObj.get("featureFlagLimitations")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 047dae8..d5398e4 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 @@ -27,7 +27,6 @@ import java.util.Arrays; import java.util.List; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -56,7 +55,7 @@ /** * Metadata of a Feature Flag or Setting. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class SettingModel { public static final String SERIALIZED_NAME_SETTING_ID = "settingId"; @SerializedName(SERIALIZED_NAME_SETTING_ID) @@ -96,7 +95,7 @@ public class SettingModel { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags; + private List tags = new ArrayList<>(); public SettingModel() { } @@ -110,7 +109,7 @@ public SettingModel settingId(Integer settingId) { * Identifier of the Feature Flag or Setting. * @return settingId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Integer getSettingId() { return settingId; } @@ -129,7 +128,7 @@ public SettingModel key(String key) { * Key of the Feature Flag or Setting. * @return key */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getKey() { return key; } @@ -148,7 +147,7 @@ public SettingModel name(String name) { * Name of the Feature Flag or Setting. * @return name */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getName() { return name; } @@ -186,7 +185,7 @@ public SettingModel order(Integer order) { * The order of the Feature Flag or Setting represented on the ConfigCat Dashboard. * @return order */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Integer getOrder() { return order; } @@ -205,7 +204,7 @@ public SettingModel settingType(SettingType settingType) { * Get settingType * @return settingType */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public SettingType getSettingType() { return settingType; } @@ -224,7 +223,7 @@ public SettingModel configId(UUID configId) { * Identifier of the Feature Flag's Config. * @return configId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getConfigId() { return configId; } @@ -243,7 +242,7 @@ public SettingModel configName(String configName) { * Name of the Feature Flag's Config. * @return configName */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getConfigName() { return configName; } @@ -289,7 +288,7 @@ public SettingModel addTagsItem(TagModel tagsItem) { * The tags attached to the Feature Flag or Setting. * @return tags */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getTags() { return tags; } @@ -366,22 +365,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, settingModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(settingId, key, name, hint, order, settingType, configId, configName, createdAt, tags, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -432,6 +420,16 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("settingId"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("hint"); + openapiRequiredFields.add("order"); + openapiRequiredFields.add("settingType"); + openapiRequiredFields.add("configId"); + openapiRequiredFields.add("configName"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("tags"); } /** @@ -446,40 +444,41 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in SettingModel is not found in the empty JSON string", SettingModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SettingModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("key") != null && !jsonObj.get("key").isJsonNull()) && !jsonObj.get("key").isJsonPrimitive()) { + 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") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } if ((jsonObj.get("hint") != null && !jsonObj.get("hint").isJsonNull()) && !jsonObj.get("hint").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); } - // validate the 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()) { + // validate the required field `settingType` + SettingType.validateJsonElement(jsonObj.get("settingType")); + if (!jsonObj.get("configId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `configId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configId").toString())); } - if ((jsonObj.get("configName") != null && !jsonObj.get("configName").isJsonNull()) && !jsonObj.get("configName").isJsonPrimitive()) { + if (!jsonObj.get("configName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `configName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configName").toString())); } - 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)); - }; - } + // ensure the json data is an array + if (!jsonObj.get("tags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); } + + JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags"); + // validate the required field `tags` (array) + for (int i = 0; i < jsonArraytags.size(); i++) { + TagModel.validateJsonElement(jsonArraytags.get(i)); + }; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 ade46fa..4ea33d7 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 @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -50,7 +49,7 @@ /** * SettingTagModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class SettingTagModel { public static final String SERIALIZED_NAME_SETTING_TAG_ID = "settingTagId"; @SerializedName(SERIALIZED_NAME_SETTING_TAG_ID) @@ -80,7 +79,7 @@ public SettingTagModel settingTagId(Long settingTagId) { * Get settingTagId * @return settingTagId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Long getSettingTagId() { return settingTagId; } @@ -99,7 +98,7 @@ public SettingTagModel tagId(Long tagId) { * Get tagId * @return tagId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Long getTagId() { return tagId; } @@ -118,7 +117,7 @@ public SettingTagModel name(String name) { * Get name * @return name */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getName() { return name; } @@ -208,22 +207,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, settingTagModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(settingTagId, tagId, name, color, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -262,6 +250,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("settingTagId"); + openapiRequiredFields.add("tagId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("color"); } /** @@ -276,8 +268,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in SettingTagModel is not found in the empty JSON string", SettingTagModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SettingTagModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + 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()) { 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 ccfa672..74570ce 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 @@ -22,6 +22,7 @@ import com.configcat.publicapi.java.client.model.RolloutRuleModel; import com.configcat.publicapi.java.client.model.SettingDataModel; import com.configcat.publicapi.java.client.model.SettingTagModel; +import com.configcat.publicapi.java.client.model.SettingValueType; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -32,7 +33,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -61,20 +61,8 @@ /** * SettingValueModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class SettingValueModel { - public static final String SERIALIZED_NAME_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; @@ -93,11 +81,23 @@ public class SettingValueModel { public static final String SERIALIZED_NAME_INTEGRATION_LINKS = "integrationLinks"; @SerializedName(SERIALIZED_NAME_INTEGRATION_LINKS) - private List integrationLinks; + private List integrationLinks = new ArrayList<>(); public static final String SERIALIZED_NAME_SETTING_TAGS = "settingTags"; @SerializedName(SERIALIZED_NAME_SETTING_TAGS) - private List settingTags; + private List settingTags = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ROLLOUT_RULES = "rolloutRules"; + @SerializedName(SERIALIZED_NAME_ROLLOUT_RULES) + private List rolloutRules = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS = "rolloutPercentageItems"; + @SerializedName(SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS) + private List rolloutPercentageItems = new ArrayList<>(); + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private SettingValueType value; public static final String SERIALIZED_NAME_CONFIG = "config"; @SerializedName(SERIALIZED_NAME_CONFIG) @@ -118,79 +118,6 @@ public class SettingValueModel { 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; @@ -200,7 +127,7 @@ public SettingValueModel setting(SettingDataModel setting) { * Get setting * @return setting */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public SettingDataModel getSetting() { return setting; } @@ -284,7 +211,7 @@ public SettingValueModel addIntegrationLinksItem(IntegrationLinkModel integratio * The integration links attached to the Feature Flag or Setting. * @return integrationLinks */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getIntegrationLinks() { return integrationLinks; } @@ -311,7 +238,7 @@ public SettingValueModel addSettingTagsItem(SettingTagModel settingTagsItem) { * The tags attached to the Feature Flag or Setting. * @return settingTags */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getSettingTags() { return settingTags; } @@ -321,6 +248,79 @@ public void setSettingTags(List settingTags) { } + public SettingValueModel rolloutRules(List rolloutRules) { + this.rolloutRules = rolloutRules; + return this; + } + + public SettingValueModel addRolloutRulesItem(RolloutRuleModel rolloutRulesItem) { + if (this.rolloutRules == null) { + this.rolloutRules = new ArrayList<>(); + } + this.rolloutRules.add(rolloutRulesItem); + return this; + } + + /** + * The targeting rule collection. + * @return rolloutRules + */ + @javax.annotation.Nonnull + public List getRolloutRules() { + return rolloutRules; + } + + public void setRolloutRules(List rolloutRules) { + this.rolloutRules = rolloutRules; + } + + + public SettingValueModel rolloutPercentageItems(List rolloutPercentageItems) { + this.rolloutPercentageItems = rolloutPercentageItems; + return this; + } + + public SettingValueModel addRolloutPercentageItemsItem(RolloutPercentageItemModel rolloutPercentageItemsItem) { + if (this.rolloutPercentageItems == null) { + this.rolloutPercentageItems = new ArrayList<>(); + } + this.rolloutPercentageItems.add(rolloutPercentageItemsItem); + return this; + } + + /** + * The percentage rule collection. + * @return rolloutPercentageItems + */ + @javax.annotation.Nonnull + public List getRolloutPercentageItems() { + return rolloutPercentageItems; + } + + public void setRolloutPercentageItems(List rolloutPercentageItems) { + this.rolloutPercentageItems = rolloutPercentageItems; + } + + + public SettingValueModel value(SettingValueType value) { + this.value = value; + return this; + } + + /** + * The value to serve. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. + * @return value + */ + @javax.annotation.Nonnull + public SettingValueType getValue() { + return value; + } + + public void setValue(SettingValueType value) { + this.value = value; + } + + public SettingValueModel config(ConfigModel config) { this.config = config; return this; @@ -330,7 +330,7 @@ public SettingValueModel config(ConfigModel config) { * Get config * @return config */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public ConfigModel getConfig() { return config; } @@ -349,7 +349,7 @@ public SettingValueModel environment(EnvironmentModel environment) { * Get environment * @return environment */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public EnvironmentModel getEnvironment() { return environment; } @@ -368,7 +368,7 @@ public SettingValueModel featureFlagLimitations(FeatureFlagLimitations featureFl * Get featureFlagLimitations * @return featureFlagLimitations */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public FeatureFlagLimitations getFeatureFlagLimitations() { return featureFlagLimitations; } @@ -387,7 +387,7 @@ public SettingValueModel readOnly(Boolean readOnly) { * Get readOnly * @return readOnly */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getReadOnly() { return readOnly; } @@ -451,15 +451,15 @@ public boolean equals(Object o) { 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) && + return Objects.equals(this.setting, settingValueModel.setting) && Objects.equals(this.updatedAt, settingValueModel.updatedAt) && Objects.equals(this.lastUpdaterUserEmail, settingValueModel.lastUpdaterUserEmail) && Objects.equals(this.lastUpdaterUserFullName, settingValueModel.lastUpdaterUserFullName) && Objects.equals(this.integrationLinks, settingValueModel.integrationLinks) && Objects.equals(this.settingTags, settingValueModel.settingTags) && + Objects.equals(this.rolloutRules, settingValueModel.rolloutRules) && + Objects.equals(this.rolloutPercentageItems, settingValueModel.rolloutPercentageItems) && + Objects.equals(this.value, settingValueModel.value) && Objects.equals(this.config, settingValueModel.config) && Objects.equals(this.environment, settingValueModel.environment) && Objects.equals(this.featureFlagLimitations, settingValueModel.featureFlagLimitations) && @@ -467,35 +467,24 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, settingValueModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { - return Objects.hash(rolloutRules, rolloutPercentageItems, value, setting, updatedAt, lastUpdaterUserEmail, lastUpdaterUserFullName, integrationLinks, settingTags, config, environment, featureFlagLimitations, readOnly, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + return Objects.hash(setting, updatedAt, lastUpdaterUserEmail, lastUpdaterUserFullName, integrationLinks, settingTags, rolloutRules, rolloutPercentageItems, value, config, environment, featureFlagLimitations, readOnly, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SettingValueModel {\n"); - sb.append(" 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(" rolloutRules: ").append(toIndentedString(rolloutRules)).append("\n"); + sb.append(" rolloutPercentageItems: ").append(toIndentedString(rolloutPercentageItems)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); sb.append(" config: ").append(toIndentedString(config)).append("\n"); sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); sb.append(" featureFlagLimitations: ").append(toIndentedString(featureFlagLimitations)).append("\n"); @@ -523,15 +512,15 @@ private String toIndentedString(Object o) { 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("rolloutRules"); + openapiFields.add("rolloutPercentageItems"); + openapiFields.add("value"); openapiFields.add("config"); openapiFields.add("environment"); openapiFields.add("featureFlagLimitations"); @@ -539,6 +528,19 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("setting"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("lastUpdaterUserEmail"); + openapiRequiredFields.add("lastUpdaterUserFullName"); + openapiRequiredFields.add("integrationLinks"); + openapiRequiredFields.add("settingTags"); + openapiRequiredFields.add("rolloutRules"); + openapiRequiredFields.add("rolloutPercentageItems"); + openapiRequiredFields.add("value"); + openapiRequiredFields.add("config"); + openapiRequiredFields.add("environment"); + openapiRequiredFields.add("featureFlagLimitations"); + openapiRequiredFields.add("readOnly"); } /** @@ -553,85 +555,70 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in SettingValueModel is not found in the empty JSON string", SettingValueModel.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("rolloutRules") != null && !jsonObj.get("rolloutRules").isJsonNull()) { - JsonArray jsonArrayrolloutRules = jsonObj.getAsJsonArray("rolloutRules"); - if (jsonArrayrolloutRules != null) { - // ensure the json data is an array - if (!jsonObj.get("rolloutRules").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rolloutRules` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutRules").toString())); - } - - // validate the optional field `rolloutRules` (array) - for (int i = 0; i < jsonArrayrolloutRules.size(); i++) { - RolloutRuleModel.validateJsonElement(jsonArrayrolloutRules.get(i)); - }; - } - } - if (jsonObj.get("rolloutPercentageItems") != null && !jsonObj.get("rolloutPercentageItems").isJsonNull()) { - JsonArray jsonArrayrolloutPercentageItems = jsonObj.getAsJsonArray("rolloutPercentageItems"); - if (jsonArrayrolloutPercentageItems != null) { - // ensure the json data is an array - if (!jsonObj.get("rolloutPercentageItems").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rolloutPercentageItems` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutPercentageItems").toString())); - } - - // validate the optional field `rolloutPercentageItems` (array) - for (int i = 0; i < jsonArrayrolloutPercentageItems.size(); i++) { - RolloutPercentageItemModel.validateJsonElement(jsonArrayrolloutPercentageItems.get(i)); - }; + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SettingValueModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } - // validate the optional field `setting` - if (jsonObj.get("setting") != null && !jsonObj.get("setting").isJsonNull()) { - SettingDataModel.validateJsonElement(jsonObj.get("setting")); - } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `setting` + SettingDataModel.validateJsonElement(jsonObj.get("setting")); if ((jsonObj.get("lastUpdaterUserEmail") != null && !jsonObj.get("lastUpdaterUserEmail").isJsonNull()) && !jsonObj.get("lastUpdaterUserEmail").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserEmail").toString())); } if ((jsonObj.get("lastUpdaterUserFullName") != null && !jsonObj.get("lastUpdaterUserFullName").isJsonNull()) && !jsonObj.get("lastUpdaterUserFullName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserFullName").toString())); } - 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 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 `config` - if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { - ConfigModel.validateJsonElement(jsonObj.get("config")); + + JsonArray jsonArrayintegrationLinks = jsonObj.getAsJsonArray("integrationLinks"); + // validate the required field `integrationLinks` (array) + for (int i = 0; i < jsonArrayintegrationLinks.size(); i++) { + IntegrationLinkModel.validateJsonElement(jsonArrayintegrationLinks.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("settingTags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settingTags` to be an array in the JSON string but got `%s`", jsonObj.get("settingTags").toString())); } - // validate the optional field `environment` - if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonNull()) { - EnvironmentModel.validateJsonElement(jsonObj.get("environment")); + + JsonArray jsonArraysettingTags = jsonObj.getAsJsonArray("settingTags"); + // validate the required field `settingTags` (array) + for (int i = 0; i < jsonArraysettingTags.size(); i++) { + SettingTagModel.validateJsonElement(jsonArraysettingTags.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("rolloutRules").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rolloutRules` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutRules").toString())); } - // validate the optional field `featureFlagLimitations` - if (jsonObj.get("featureFlagLimitations") != null && !jsonObj.get("featureFlagLimitations").isJsonNull()) { - FeatureFlagLimitations.validateJsonElement(jsonObj.get("featureFlagLimitations")); + + JsonArray jsonArrayrolloutRules = jsonObj.getAsJsonArray("rolloutRules"); + // validate the required field `rolloutRules` (array) + for (int i = 0; i < jsonArrayrolloutRules.size(); i++) { + RolloutRuleModel.validateJsonElement(jsonArrayrolloutRules.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("rolloutPercentageItems").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rolloutPercentageItems` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutPercentageItems").toString())); } + + JsonArray jsonArrayrolloutPercentageItems = jsonObj.getAsJsonArray("rolloutPercentageItems"); + // validate the required field `rolloutPercentageItems` (array) + for (int i = 0; i < jsonArrayrolloutPercentageItems.size(); i++) { + RolloutPercentageItemModel.validateJsonElement(jsonArrayrolloutPercentageItems.get(i)); + }; + // validate the required field `value` + SettingValueType.validateJsonElement(jsonObj.get("value")); + // validate the required field `config` + ConfigModel.validateJsonElement(jsonObj.get("config")); + // validate the required field `environment` + EnvironmentModel.validateJsonElement(jsonObj.get("environment")); + // validate the required field `featureFlagLimitations` + FeatureFlagLimitations.validateJsonElement(jsonObj.get("featureFlagLimitations")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SettingValueType.java b/src/main/java/com/configcat/publicapi/java/client/model/SettingValueType.java new file mode 100644 index 0000000..5f9844d --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/SettingValueType.java @@ -0,0 +1,320 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.configcat.publicapi.java.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class SettingValueType extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(SettingValueType.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SettingValueType.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SettingValueType' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterBoolean = gson.getDelegateAdapter(this, TypeToken.get(Boolean.class)); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter adapterDouble = gson.getDelegateAdapter(this, TypeToken.get(Double.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SettingValueType value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Boolean` + if (value.getActualInstance() instanceof Boolean) { + JsonPrimitive primitive = adapterBoolean.toJsonTree((Boolean)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Double` + if (value.getActualInstance() instanceof Double) { + JsonPrimitive primitive = adapterDouble.toJsonTree((Double)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Boolean, Double, String"); + } + + @Override + public SettingValueType read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Boolean + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isBoolean()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Boolean in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterBoolean; + match++; + log.log(Level.FINER, "Input data matches schema 'Boolean'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Boolean failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Boolean'", e); + } + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Double + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterDouble; + match++; + log.log(Level.FINER, "Input data matches schema 'Double'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Double failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Double'", e); + } + + if (match == 1) { + SettingValueType ret = new SettingValueType(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for SettingValueType: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public SettingValueType() { + super("oneOf", Boolean.FALSE); + } + + public SettingValueType(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Boolean", Boolean.class); + schemas.put("String", String.class); + schemas.put("Double", Double.class); + } + + @Override + public Map> getSchemas() { + return SettingValueType.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Boolean, Double, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Boolean) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Double) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Boolean, Double, String"); + } + + /** + * Get the actual instance, which can be the following: + * Boolean, Double, String + * + * @return The actual instance (Boolean, Double, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Boolean`. If the actual instance is not `Boolean`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Boolean` + * @throws ClassCastException if the instance is not `Boolean` + */ + public Boolean getBoolean() throws ClassCastException { + return (Boolean)super.getActualInstance(); + } + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + /** + * Get the actual instance of `Double`. If the actual instance is not `Double`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Double` + * @throws ClassCastException if the instance is not `Double` + */ + public Double getDouble() throws ClassCastException { + return (Double)super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SettingValueType + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Boolean + try { + if (!jsonElement.getAsJsonPrimitive().isBoolean()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Boolean in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Boolean failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Double + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Double failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for SettingValueType with oneOf schemas: Boolean, Double, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of SettingValueType given an JSON string + * + * @param jsonString JSON string + * @return An instance of SettingValueType + * @throws IOException if the JSON string is invalid with respect to SettingValueType + */ + public static SettingValueType fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SettingValueType.class); + } + + /** + * Convert an instance of SettingValueType to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagConfigModel.java b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagConfigModel.java new file mode 100644 index 0000000..3722f44 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagConfigModel.java @@ -0,0 +1,431 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.EvaluationVersion; +import com.configcat.publicapi.java.client.model.StaleFlagSettingModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * StaleFlagConfigModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class StaleFlagConfigModel { + public static final String SERIALIZED_NAME_CONFIG_ID = "configId"; + @SerializedName(SERIALIZED_NAME_CONFIG_ID) + private UUID configId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_EVALUATION_VERSION = "evaluationVersion"; + @SerializedName(SERIALIZED_NAME_EVALUATION_VERSION) + private EvaluationVersion evaluationVersion; + + public static final String SERIALIZED_NAME_HAS_CODE_REFERENCES = "hasCodeReferences"; + @SerializedName(SERIALIZED_NAME_HAS_CODE_REFERENCES) + private Boolean hasCodeReferences; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + @SerializedName(SERIALIZED_NAME_SETTINGS) + private List settings = new ArrayList<>(); + + public StaleFlagConfigModel() { + } + + public StaleFlagConfigModel configId(UUID configId) { + this.configId = configId; + return this; + } + + /** + * Identifier of the Config. + * @return configId + */ + @javax.annotation.Nonnull + public UUID getConfigId() { + return configId; + } + + public void setConfigId(UUID configId) { + this.configId = configId; + } + + + public StaleFlagConfigModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Config. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public StaleFlagConfigModel evaluationVersion(EvaluationVersion evaluationVersion) { + this.evaluationVersion = evaluationVersion; + return this; + } + + /** + * Get evaluationVersion + * @return evaluationVersion + */ + @javax.annotation.Nonnull + public EvaluationVersion getEvaluationVersion() { + return evaluationVersion; + } + + public void setEvaluationVersion(EvaluationVersion evaluationVersion) { + this.evaluationVersion = evaluationVersion; + } + + + public StaleFlagConfigModel hasCodeReferences(Boolean hasCodeReferences) { + this.hasCodeReferences = hasCodeReferences; + return this; + } + + /** + * Config has code references uploaded. + * @return hasCodeReferences + */ + @javax.annotation.Nonnull + public Boolean getHasCodeReferences() { + return hasCodeReferences; + } + + public void setHasCodeReferences(Boolean hasCodeReferences) { + this.hasCodeReferences = hasCodeReferences; + } + + + public StaleFlagConfigModel settings(List settings) { + this.settings = settings; + return this; + } + + public StaleFlagConfigModel addSettingsItem(StaleFlagSettingModel settingsItem) { + if (this.settings == null) { + this.settings = new ArrayList<>(); + } + this.settings.add(settingsItem); + return this; + } + + /** + * Stale feature flags. + * @return settings + */ + @javax.annotation.Nonnull + public List getSettings() { + return settings; + } + + public void setSettings(List settings) { + this.settings = settings; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the StaleFlagConfigModel instance itself + */ + public StaleFlagConfigModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StaleFlagConfigModel staleFlagConfigModel = (StaleFlagConfigModel) o; + return Objects.equals(this.configId, staleFlagConfigModel.configId) && + Objects.equals(this.name, staleFlagConfigModel.name) && + Objects.equals(this.evaluationVersion, staleFlagConfigModel.evaluationVersion) && + Objects.equals(this.hasCodeReferences, staleFlagConfigModel.hasCodeReferences) && + Objects.equals(this.settings, staleFlagConfigModel.settings)&& + Objects.equals(this.additionalProperties, staleFlagConfigModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(configId, name, evaluationVersion, hasCodeReferences, settings, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StaleFlagConfigModel {\n"); + sb.append(" configId: ").append(toIndentedString(configId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" evaluationVersion: ").append(toIndentedString(evaluationVersion)).append("\n"); + sb.append(" hasCodeReferences: ").append(toIndentedString(hasCodeReferences)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("configId"); + openapiFields.add("name"); + openapiFields.add("evaluationVersion"); + openapiFields.add("hasCodeReferences"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("configId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("evaluationVersion"); + openapiRequiredFields.add("hasCodeReferences"); + openapiRequiredFields.add("settings"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StaleFlagConfigModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StaleFlagConfigModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StaleFlagConfigModel is not found in the empty JSON string", StaleFlagConfigModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StaleFlagConfigModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("configId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `configId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // validate the required field `evaluationVersion` + EvaluationVersion.validateJsonElement(jsonObj.get("evaluationVersion")); + // ensure the json data is an array + if (!jsonObj.get("settings").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settings` to be an array in the JSON string but got `%s`", jsonObj.get("settings").toString())); + } + + JsonArray jsonArraysettings = jsonObj.getAsJsonArray("settings"); + // validate the required field `settings` (array) + for (int i = 0; i < jsonArraysettings.size(); i++) { + StaleFlagSettingModel.validateJsonElement(jsonArraysettings.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StaleFlagConfigModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StaleFlagConfigModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StaleFlagConfigModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StaleFlagConfigModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public StaleFlagConfigModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StaleFlagConfigModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StaleFlagConfigModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of StaleFlagConfigModel + * @throws IOException if the JSON string is invalid with respect to StaleFlagConfigModel + */ + public static StaleFlagConfigModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StaleFlagConfigModel.class); + } + + /** + * Convert an instance of StaleFlagConfigModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagEnvironmentModel.java b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagEnvironmentModel.java new file mode 100644 index 0000000..0a357ac --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagEnvironmentModel.java @@ -0,0 +1,326 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * StaleFlagEnvironmentModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class StaleFlagEnvironmentModel { + public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) + private UUID environmentId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public StaleFlagEnvironmentModel() { + } + + public StaleFlagEnvironmentModel environmentId(UUID environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Identifier of the Environment. + * @return environmentId + */ + @javax.annotation.Nonnull + public UUID getEnvironmentId() { + return environmentId; + } + + public void setEnvironmentId(UUID environmentId) { + this.environmentId = environmentId; + } + + + public StaleFlagEnvironmentModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Environment. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the StaleFlagEnvironmentModel instance itself + */ + public StaleFlagEnvironmentModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StaleFlagEnvironmentModel staleFlagEnvironmentModel = (StaleFlagEnvironmentModel) o; + return Objects.equals(this.environmentId, staleFlagEnvironmentModel.environmentId) && + Objects.equals(this.name, staleFlagEnvironmentModel.name)&& + Objects.equals(this.additionalProperties, staleFlagEnvironmentModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(environmentId, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StaleFlagEnvironmentModel {\n"); + sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("environmentId"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("environmentId"); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StaleFlagEnvironmentModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StaleFlagEnvironmentModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StaleFlagEnvironmentModel is not found in the empty JSON string", StaleFlagEnvironmentModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StaleFlagEnvironmentModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("environmentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StaleFlagEnvironmentModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StaleFlagEnvironmentModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StaleFlagEnvironmentModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StaleFlagEnvironmentModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public StaleFlagEnvironmentModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StaleFlagEnvironmentModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StaleFlagEnvironmentModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of StaleFlagEnvironmentModel + * @throws IOException if the JSON string is invalid with respect to StaleFlagEnvironmentModel + */ + public static StaleFlagEnvironmentModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StaleFlagEnvironmentModel.class); + } + + /** + * Convert an instance of StaleFlagEnvironmentModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagProductModel.java b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagProductModel.java new file mode 100644 index 0000000..c35f7be --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagProductModel.java @@ -0,0 +1,420 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.StaleFlagConfigModel; +import com.configcat.publicapi.java.client.model.StaleFlagEnvironmentModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * StaleFlagProductModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class StaleFlagProductModel { + public static final String SERIALIZED_NAME_PRODUCT_ID = "productId"; + @SerializedName(SERIALIZED_NAME_PRODUCT_ID) + private UUID productId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_CONFIGS = "configs"; + @SerializedName(SERIALIZED_NAME_CONFIGS) + private List configs = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ENVIRONMENTS = "environments"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENTS) + private List environments = new ArrayList<>(); + + public StaleFlagProductModel() { + } + + public StaleFlagProductModel productId(UUID productId) { + this.productId = productId; + return this; + } + + /** + * Identifier of the Product. + * @return productId + */ + @javax.annotation.Nonnull + public UUID getProductId() { + return productId; + } + + public void setProductId(UUID productId) { + this.productId = productId; + } + + + public StaleFlagProductModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Product. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public StaleFlagProductModel configs(List configs) { + this.configs = configs; + return this; + } + + public StaleFlagProductModel addConfigsItem(StaleFlagConfigModel configsItem) { + if (this.configs == null) { + this.configs = new ArrayList<>(); + } + this.configs.add(configsItem); + return this; + } + + /** + * Configs that contain stale feature flags. + * @return configs + */ + @javax.annotation.Nonnull + public List getConfigs() { + return configs; + } + + public void setConfigs(List configs) { + this.configs = configs; + } + + + public StaleFlagProductModel environments(List environments) { + this.environments = environments; + return this; + } + + public StaleFlagProductModel addEnvironmentsItem(StaleFlagEnvironmentModel environmentsItem) { + if (this.environments == null) { + this.environments = new ArrayList<>(); + } + this.environments.add(environmentsItem); + return this; + } + + /** + * Environment list. + * @return environments + */ + @javax.annotation.Nonnull + public List getEnvironments() { + return environments; + } + + public void setEnvironments(List environments) { + this.environments = environments; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the StaleFlagProductModel instance itself + */ + public StaleFlagProductModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StaleFlagProductModel staleFlagProductModel = (StaleFlagProductModel) o; + return Objects.equals(this.productId, staleFlagProductModel.productId) && + Objects.equals(this.name, staleFlagProductModel.name) && + Objects.equals(this.configs, staleFlagProductModel.configs) && + Objects.equals(this.environments, staleFlagProductModel.environments)&& + Objects.equals(this.additionalProperties, staleFlagProductModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(productId, name, configs, environments, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StaleFlagProductModel {\n"); + sb.append(" productId: ").append(toIndentedString(productId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" configs: ").append(toIndentedString(configs)).append("\n"); + sb.append(" environments: ").append(toIndentedString(environments)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("productId"); + openapiFields.add("name"); + openapiFields.add("configs"); + openapiFields.add("environments"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("productId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("configs"); + openapiRequiredFields.add("environments"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StaleFlagProductModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StaleFlagProductModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StaleFlagProductModel is not found in the empty JSON string", StaleFlagProductModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StaleFlagProductModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("productId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `productId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("configs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `configs` to be an array in the JSON string but got `%s`", jsonObj.get("configs").toString())); + } + + JsonArray jsonArrayconfigs = jsonObj.getAsJsonArray("configs"); + // validate the required field `configs` (array) + for (int i = 0; i < jsonArrayconfigs.size(); i++) { + StaleFlagConfigModel.validateJsonElement(jsonArrayconfigs.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("environments").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `environments` to be an array in the JSON string but got `%s`", jsonObj.get("environments").toString())); + } + + JsonArray jsonArrayenvironments = jsonObj.getAsJsonArray("environments"); + // validate the required field `environments` (array) + for (int i = 0; i < jsonArrayenvironments.size(); i++) { + StaleFlagEnvironmentModel.validateJsonElement(jsonArrayenvironments.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StaleFlagProductModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StaleFlagProductModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StaleFlagProductModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StaleFlagProductModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public StaleFlagProductModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StaleFlagProductModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StaleFlagProductModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of StaleFlagProductModel + * @throws IOException if the JSON string is invalid with respect to StaleFlagProductModel + */ + public static StaleFlagProductModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StaleFlagProductModel.class); + } + + /** + * Convert an instance of StaleFlagProductModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagReminderScope.java b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagReminderScope.java new file mode 100644 index 0000000..7a8ce7f --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagReminderScope.java @@ -0,0 +1,78 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets StaleFlagReminderScope + */ +@JsonAdapter(StaleFlagReminderScope.Adapter.class) +public enum StaleFlagReminderScope { + + ALL("all"), + + WATCHED_BY_ME("watchedByMe"); + + private String value; + + StaleFlagReminderScope(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StaleFlagReminderScope fromValue(String value) { + for (StaleFlagReminderScope b : StaleFlagReminderScope.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StaleFlagReminderScope enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StaleFlagReminderScope read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StaleFlagReminderScope.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StaleFlagReminderScope.fromValue(value); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingModel.java b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingModel.java new file mode 100644 index 0000000..93aceef --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingModel.java @@ -0,0 +1,503 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.StaleFlagSettingTagModel; +import com.configcat.publicapi.java.client.model.StaleFlagSettingValueModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * StaleFlagSettingModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class StaleFlagSettingModel { + public static final String SERIALIZED_NAME_SETTING_ID = "settingId"; + @SerializedName(SERIALIZED_NAME_SETTING_ID) + private Integer settingId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_HINT = "hint"; + @SerializedName(SERIALIZED_NAME_HINT) + private String hint; + + public static final String SERIALIZED_NAME_HAS_CODE_REFERENCES = "hasCodeReferences"; + @SerializedName(SERIALIZED_NAME_HAS_CODE_REFERENCES) + private Boolean hasCodeReferences; + + public static final String SERIALIZED_NAME_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + private List tags = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SETTING_VALUES = "settingValues"; + @SerializedName(SERIALIZED_NAME_SETTING_VALUES) + private List settingValues = new ArrayList<>(); + + public StaleFlagSettingModel() { + } + + public StaleFlagSettingModel settingId(Integer settingId) { + this.settingId = settingId; + return this; + } + + /** + * Identifier of the Feature Flag or Setting. + * @return settingId + */ + @javax.annotation.Nonnull + public Integer getSettingId() { + return settingId; + } + + public void setSettingId(Integer settingId) { + this.settingId = settingId; + } + + + public StaleFlagSettingModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Feature Flag or Setting. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public StaleFlagSettingModel key(String key) { + this.key = key; + return this; + } + + /** + * Key of the Feature Flag or Setting. + * @return key + */ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + + public StaleFlagSettingModel hint(String hint) { + this.hint = hint; + return this; + } + + /** + * Description of the Feature Flag or Setting. + * @return hint + */ + @javax.annotation.Nullable + public String getHint() { + return hint; + } + + public void setHint(String hint) { + this.hint = hint; + } + + + public StaleFlagSettingModel hasCodeReferences(Boolean hasCodeReferences) { + this.hasCodeReferences = hasCodeReferences; + return this; + } + + /** + * Feature Flag or Setting has code references uploaded. + * @return hasCodeReferences + */ + @javax.annotation.Nonnull + public Boolean getHasCodeReferences() { + return hasCodeReferences; + } + + public void setHasCodeReferences(Boolean hasCodeReferences) { + this.hasCodeReferences = hasCodeReferences; + } + + + public StaleFlagSettingModel tags(List tags) { + this.tags = tags; + return this; + } + + public StaleFlagSettingModel addTagsItem(StaleFlagSettingTagModel tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * The tags' identifiers attached to the Feature Flag or Setting. + * @return tags + */ + @javax.annotation.Nonnull + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + + public StaleFlagSettingModel settingValues(List settingValues) { + this.settingValues = settingValues; + return this; + } + + public StaleFlagSettingModel addSettingValuesItem(StaleFlagSettingValueModel settingValuesItem) { + if (this.settingValues == null) { + this.settingValues = new ArrayList<>(); + } + this.settingValues.add(settingValuesItem); + return this; + } + + /** + * Environment level feature flag stale data. + * @return settingValues + */ + @javax.annotation.Nonnull + public List getSettingValues() { + return settingValues; + } + + public void setSettingValues(List settingValues) { + this.settingValues = settingValues; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the StaleFlagSettingModel instance itself + */ + public StaleFlagSettingModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StaleFlagSettingModel staleFlagSettingModel = (StaleFlagSettingModel) o; + return Objects.equals(this.settingId, staleFlagSettingModel.settingId) && + Objects.equals(this.name, staleFlagSettingModel.name) && + Objects.equals(this.key, staleFlagSettingModel.key) && + Objects.equals(this.hint, staleFlagSettingModel.hint) && + Objects.equals(this.hasCodeReferences, staleFlagSettingModel.hasCodeReferences) && + Objects.equals(this.tags, staleFlagSettingModel.tags) && + Objects.equals(this.settingValues, staleFlagSettingModel.settingValues)&& + Objects.equals(this.additionalProperties, staleFlagSettingModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(settingId, name, key, hint, hasCodeReferences, tags, settingValues, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StaleFlagSettingModel {\n"); + sb.append(" settingId: ").append(toIndentedString(settingId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); + sb.append(" hasCodeReferences: ").append(toIndentedString(hasCodeReferences)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" settingValues: ").append(toIndentedString(settingValues)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("settingId"); + openapiFields.add("name"); + openapiFields.add("key"); + openapiFields.add("hint"); + openapiFields.add("hasCodeReferences"); + openapiFields.add("tags"); + openapiFields.add("settingValues"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("settingId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("hint"); + openapiRequiredFields.add("hasCodeReferences"); + openapiRequiredFields.add("tags"); + openapiRequiredFields.add("settingValues"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StaleFlagSettingModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StaleFlagSettingModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StaleFlagSettingModel is not found in the empty JSON string", StaleFlagSettingModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StaleFlagSettingModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if ((jsonObj.get("hint") != null && !jsonObj.get("hint").isJsonNull()) && !jsonObj.get("hint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("tags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); + } + + JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags"); + // validate the required field `tags` (array) + for (int i = 0; i < jsonArraytags.size(); i++) { + StaleFlagSettingTagModel.validateJsonElement(jsonArraytags.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("settingValues").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settingValues` to be an array in the JSON string but got `%s`", jsonObj.get("settingValues").toString())); + } + + JsonArray jsonArraysettingValues = jsonObj.getAsJsonArray("settingValues"); + // validate the required field `settingValues` (array) + for (int i = 0; i < jsonArraysettingValues.size(); i++) { + StaleFlagSettingValueModel.validateJsonElement(jsonArraysettingValues.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StaleFlagSettingModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StaleFlagSettingModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StaleFlagSettingModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StaleFlagSettingModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public StaleFlagSettingModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StaleFlagSettingModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StaleFlagSettingModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of StaleFlagSettingModel + * @throws IOException if the JSON string is invalid with respect to StaleFlagSettingModel + */ + public static StaleFlagSettingModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StaleFlagSettingModel.class); + } + + /** + * Convert an instance of StaleFlagSettingModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingTagModel.java b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingTagModel.java new file mode 100644 index 0000000..110f0c8 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingTagModel.java @@ -0,0 +1,319 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * StaleFlagSettingTagModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class StaleFlagSettingTagModel { + public static final String SERIALIZED_NAME_TAG_ID = "tagId"; + @SerializedName(SERIALIZED_NAME_TAG_ID) + private Long tagId; + + public static final String SERIALIZED_NAME_SETTING_TAG_ID = "settingTagId"; + @SerializedName(SERIALIZED_NAME_SETTING_TAG_ID) + private Long settingTagId; + + public StaleFlagSettingTagModel() { + } + + public StaleFlagSettingTagModel tagId(Long tagId) { + this.tagId = tagId; + return this; + } + + /** + * Get tagId + * @return tagId + */ + @javax.annotation.Nonnull + public Long getTagId() { + return tagId; + } + + public void setTagId(Long tagId) { + this.tagId = tagId; + } + + + public StaleFlagSettingTagModel settingTagId(Long settingTagId) { + this.settingTagId = settingTagId; + return this; + } + + /** + * Get settingTagId + * @return settingTagId + */ + @javax.annotation.Nonnull + public Long getSettingTagId() { + return settingTagId; + } + + public void setSettingTagId(Long settingTagId) { + this.settingTagId = settingTagId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the StaleFlagSettingTagModel instance itself + */ + public StaleFlagSettingTagModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StaleFlagSettingTagModel staleFlagSettingTagModel = (StaleFlagSettingTagModel) o; + return Objects.equals(this.tagId, staleFlagSettingTagModel.tagId) && + Objects.equals(this.settingTagId, staleFlagSettingTagModel.settingTagId)&& + Objects.equals(this.additionalProperties, staleFlagSettingTagModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(tagId, settingTagId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StaleFlagSettingTagModel {\n"); + sb.append(" tagId: ").append(toIndentedString(tagId)).append("\n"); + sb.append(" settingTagId: ").append(toIndentedString(settingTagId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("tagId"); + openapiFields.add("settingTagId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("tagId"); + openapiRequiredFields.add("settingTagId"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StaleFlagSettingTagModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StaleFlagSettingTagModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StaleFlagSettingTagModel is not found in the empty JSON string", StaleFlagSettingTagModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StaleFlagSettingTagModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StaleFlagSettingTagModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StaleFlagSettingTagModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StaleFlagSettingTagModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StaleFlagSettingTagModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public StaleFlagSettingTagModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StaleFlagSettingTagModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StaleFlagSettingTagModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of StaleFlagSettingTagModel + * @throws IOException if the JSON string is invalid with respect to StaleFlagSettingTagModel + */ + public static StaleFlagSettingTagModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StaleFlagSettingTagModel.class); + } + + /** + * Convert an instance of StaleFlagSettingTagModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingValueModel.java b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingValueModel.java new file mode 100644 index 0000000..72d3e1b --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingValueModel.java @@ -0,0 +1,351 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * StaleFlagSettingValueModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class StaleFlagSettingValueModel { + public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) + private UUID environmentId; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_IS_STALE = "isStale"; + @SerializedName(SERIALIZED_NAME_IS_STALE) + private Boolean isStale; + + public StaleFlagSettingValueModel() { + } + + public StaleFlagSettingValueModel environmentId(UUID environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Identifier of the Environment. + * @return environmentId + */ + @javax.annotation.Nonnull + public UUID getEnvironmentId() { + return environmentId; + } + + public void setEnvironmentId(UUID environmentId) { + this.environmentId = environmentId; + } + + + public StaleFlagSettingValueModel updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * The last updated date and time when the Feature Flag or Setting. + * @return updatedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + public StaleFlagSettingValueModel isStale(Boolean isStale) { + this.isStale = isStale; + return this; + } + + /** + * Is the feature flag considered stale in the environment. + * @return isStale + */ + @javax.annotation.Nonnull + public Boolean getIsStale() { + return isStale; + } + + public void setIsStale(Boolean isStale) { + this.isStale = isStale; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the StaleFlagSettingValueModel instance itself + */ + public StaleFlagSettingValueModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StaleFlagSettingValueModel staleFlagSettingValueModel = (StaleFlagSettingValueModel) o; + return Objects.equals(this.environmentId, staleFlagSettingValueModel.environmentId) && + Objects.equals(this.updatedAt, staleFlagSettingValueModel.updatedAt) && + Objects.equals(this.isStale, staleFlagSettingValueModel.isStale)&& + Objects.equals(this.additionalProperties, staleFlagSettingValueModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(environmentId, updatedAt, isStale, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StaleFlagSettingValueModel {\n"); + sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" isStale: ").append(toIndentedString(isStale)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("environmentId"); + openapiFields.add("updatedAt"); + openapiFields.add("isStale"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("environmentId"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("isStale"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StaleFlagSettingValueModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StaleFlagSettingValueModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StaleFlagSettingValueModel is not found in the empty JSON string", StaleFlagSettingValueModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StaleFlagSettingValueModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("environmentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StaleFlagSettingValueModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StaleFlagSettingValueModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StaleFlagSettingValueModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StaleFlagSettingValueModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public StaleFlagSettingValueModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StaleFlagSettingValueModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StaleFlagSettingValueModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of StaleFlagSettingValueModel + * @throws IOException if the JSON string is invalid with respect to StaleFlagSettingValueModel + */ + public static StaleFlagSettingValueModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StaleFlagSettingValueModel.class); + } + + /** + * Convert an instance of StaleFlagSettingValueModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagStaleInEnvironmentsType.java b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagStaleInEnvironmentsType.java new file mode 100644 index 0000000..4e41b7e --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagStaleInEnvironmentsType.java @@ -0,0 +1,78 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets StaleFlagStaleInEnvironmentsType + */ +@JsonAdapter(StaleFlagStaleInEnvironmentsType.Adapter.class) +public enum StaleFlagStaleInEnvironmentsType { + + STALE_IN_ANY_ENVIRONMENTS("staleInAnyEnvironments"), + + STALE_IN_ALL_ENVIRONMENTS("staleInAllEnvironments"); + + private String value; + + StaleFlagStaleInEnvironmentsType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StaleFlagStaleInEnvironmentsType fromValue(String value) { + for (StaleFlagStaleInEnvironmentsType b : StaleFlagStaleInEnvironmentsType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StaleFlagStaleInEnvironmentsType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StaleFlagStaleInEnvironmentsType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StaleFlagStaleInEnvironmentsType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StaleFlagStaleInEnvironmentsType.fromValue(value); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/TagModel.java b/src/main/java/com/configcat/publicapi/java/client/model/TagModel.java index e56cccd..190e480 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 @@ -22,7 +22,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -51,7 +50,7 @@ /** * TagModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class TagModel { public static final String SERIALIZED_NAME_PRODUCT = "product"; @SerializedName(SERIALIZED_NAME_PRODUCT) @@ -81,7 +80,7 @@ public TagModel product(ProductModel product) { * Get product * @return product */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public ProductModel getProduct() { return product; } @@ -100,7 +99,7 @@ public TagModel tagId(Long tagId) { * Identifier of the Tag. * @return tagId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Long getTagId() { return tagId; } @@ -119,7 +118,7 @@ public TagModel name(String name) { * Name of the Tag. * @return name */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getName() { return name; } @@ -209,22 +208,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, tagModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(product, tagId, name, color, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -263,6 +251,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("product"); + openapiRequiredFields.add("tagId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("color"); } /** @@ -277,12 +269,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in TagModel is not found in the empty JSON string", TagModel.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `product` - if (jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) { - ProductModel.validateJsonElement(jsonObj.get("product")); + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TagModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `product` + ProductModel.validateJsonElement(jsonObj.get("product")); + if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } if ((jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) && !jsonObj.get("color").isJsonPrimitive()) { 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 6c9a448..3d021c1 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 @@ -26,7 +26,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -55,15 +54,15 @@ /** * TargetingRuleModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class TargetingRuleModel { public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; @SerializedName(SERIALIZED_NAME_CONDITIONS) - private List conditions; + private List conditions = new ArrayList<>(); public static final String SERIALIZED_NAME_PERCENTAGE_OPTIONS = "percentageOptions"; @SerializedName(SERIALIZED_NAME_PERCENTAGE_OPTIONS) - private List percentageOptions; + private List percentageOptions = new ArrayList<>(); public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) @@ -86,10 +85,10 @@ public TargetingRuleModel addConditionsItem(ConditionModel conditionsItem) { } /** - * 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 + * 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 + @javax.annotation.Nonnull public List getConditions() { return conditions; } @@ -116,7 +115,7 @@ public TargetingRuleModel addPercentageOptionsItem(PercentageOptionModel percent * 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 + @javax.annotation.Nonnull public List getPercentageOptions() { return percentageOptions; } @@ -205,22 +204,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, targetingRuleModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(conditions, percentageOptions, value, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -257,6 +245,9 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("conditions"); + openapiRequiredFields.add("percentageOptions"); + openapiRequiredFields.add("value"); } /** @@ -271,39 +262,36 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in TargetingRuleModel is not found in the empty JSON string", TargetingRuleModel.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("conditions") != null && !jsonObj.get("conditions").isJsonNull()) { - JsonArray jsonArrayconditions = jsonObj.getAsJsonArray("conditions"); - if (jsonArrayconditions != null) { - // ensure the json data is an array - if (!jsonObj.get("conditions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `conditions` to be an array in the JSON string but got `%s`", jsonObj.get("conditions").toString())); - } - - // validate the optional field `conditions` (array) - for (int i = 0; i < jsonArrayconditions.size(); i++) { - ConditionModel.validateJsonElement(jsonArrayconditions.get(i)); - }; + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TargetingRuleModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } - 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)); - }; - } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("conditions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `conditions` to be an array in the JSON string but got `%s`", jsonObj.get("conditions").toString())); } - // validate the optional field `value` - if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { - ValueModel.validateJsonElement(jsonObj.get("value")); + + JsonArray jsonArrayconditions = jsonObj.getAsJsonArray("conditions"); + // validate the required field `conditions` (array) + for (int i = 0; i < jsonArrayconditions.size(); i++) { + ConditionModel.validateJsonElement(jsonArrayconditions.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("percentageOptions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `percentageOptions` to be an array in the JSON string but got `%s`", jsonObj.get("percentageOptions").toString())); } + + JsonArray jsonArraypercentageOptions = jsonObj.getAsJsonArray("percentageOptions"); + // validate the required field `percentageOptions` (array) + for (int i = 0; i < jsonArraypercentageOptions.size(); i++) { + PercentageOptionModel.validateJsonElement(jsonArraypercentageOptions.get(i)); + }; + // validate the required field `value` + ValueModel.validateJsonElement(jsonObj.get("value")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateComparisonValueListModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateComparisonValueListModel.java new file mode 100644 index 0000000..a25ef52 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateComparisonValueListModel.java @@ -0,0 +1,336 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateComparisonValueListModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateComparisonValueListModel { + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_HINT = "hint"; + @SerializedName(SERIALIZED_NAME_HINT) + private String hint; + + public UpdateComparisonValueListModel() { + } + + public UpdateComparisonValueListModel value(String value) { + this.value = value; + return this; + } + + /** + * The actual comparison value. + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + public UpdateComparisonValueListModel hint(String hint) { + this.hint = hint; + return this; + } + + /** + * An optional hint for the comparison value. + * @return hint + */ + @javax.annotation.Nullable + public String getHint() { + return hint; + } + + public void setHint(String hint) { + this.hint = hint; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateComparisonValueListModel instance itself + */ + public UpdateComparisonValueListModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateComparisonValueListModel updateComparisonValueListModel = (UpdateComparisonValueListModel) o; + return Objects.equals(this.value, updateComparisonValueListModel.value) && + Objects.equals(this.hint, updateComparisonValueListModel.hint)&& + Objects.equals(this.additionalProperties, updateComparisonValueListModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(value, hint, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateComparisonValueListModel {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("value"); + openapiFields.add("hint"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateComparisonValueListModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateComparisonValueListModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateComparisonValueListModel is not found in the empty JSON string", UpdateComparisonValueListModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateComparisonValueListModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + if ((jsonObj.get("hint") != null && !jsonObj.get("hint").isJsonNull()) && !jsonObj.get("hint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateComparisonValueListModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateComparisonValueListModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateComparisonValueListModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateComparisonValueListModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateComparisonValueListModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateComparisonValueListModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateComparisonValueListModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateComparisonValueListModel + * @throws IOException if the JSON string is invalid with respect to UpdateComparisonValueListModel + */ + public static UpdateComparisonValueListModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateComparisonValueListModel.class); + } + + /** + * Convert an instance of UpdateComparisonValueListModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateComparisonValueModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateComparisonValueModel.java new file mode 100644 index 0000000..c36dab3 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateComparisonValueModel.java @@ -0,0 +1,376 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.UpdateComparisonValueListModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * The value that the user object's attribute is compared to. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateComparisonValueModel { + public static final String SERIALIZED_NAME_STRING_VALUE = "stringValue"; + @SerializedName(SERIALIZED_NAME_STRING_VALUE) + private String stringValue; + + public static final String SERIALIZED_NAME_DOUBLE_VALUE = "doubleValue"; + @SerializedName(SERIALIZED_NAME_DOUBLE_VALUE) + private Double doubleValue; + + public static final String SERIALIZED_NAME_LIST_VALUE = "listValue"; + @SerializedName(SERIALIZED_NAME_LIST_VALUE) + private List listValue; + + public UpdateComparisonValueModel() { + } + + public UpdateComparisonValueModel stringValue(String stringValue) { + this.stringValue = stringValue; + return this; + } + + /** + * The string representation of the comparison value. + * @return stringValue + */ + @javax.annotation.Nullable + public String getStringValue() { + return stringValue; + } + + public void setStringValue(String stringValue) { + this.stringValue = stringValue; + } + + + public UpdateComparisonValueModel doubleValue(Double doubleValue) { + this.doubleValue = doubleValue; + return this; + } + + /** + * The number representation of the comparison value. + * @return doubleValue + */ + @javax.annotation.Nullable + public Double getDoubleValue() { + return doubleValue; + } + + public void setDoubleValue(Double doubleValue) { + this.doubleValue = doubleValue; + } + + + public UpdateComparisonValueModel listValue(List listValue) { + this.listValue = listValue; + return this; + } + + public UpdateComparisonValueModel addListValueItem(UpdateComparisonValueListModel listValueItem) { + if (this.listValue == null) { + this.listValue = new ArrayList<>(); + } + this.listValue.add(listValueItem); + return this; + } + + /** + * The list representation of the comparison value. + * @return listValue + */ + @javax.annotation.Nullable + public List getListValue() { + return listValue; + } + + public void setListValue(List listValue) { + this.listValue = listValue; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateComparisonValueModel instance itself + */ + public UpdateComparisonValueModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateComparisonValueModel updateComparisonValueModel = (UpdateComparisonValueModel) o; + return Objects.equals(this.stringValue, updateComparisonValueModel.stringValue) && + Objects.equals(this.doubleValue, updateComparisonValueModel.doubleValue) && + Objects.equals(this.listValue, updateComparisonValueModel.listValue)&& + Objects.equals(this.additionalProperties, updateComparisonValueModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(stringValue, doubleValue, listValue, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateComparisonValueModel {\n"); + sb.append(" stringValue: ").append(toIndentedString(stringValue)).append("\n"); + sb.append(" doubleValue: ").append(toIndentedString(doubleValue)).append("\n"); + sb.append(" listValue: ").append(toIndentedString(listValue)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("stringValue"); + openapiFields.add("doubleValue"); + openapiFields.add("listValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateComparisonValueModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateComparisonValueModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateComparisonValueModel is not found in the empty JSON string", UpdateComparisonValueModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("stringValue") != null && !jsonObj.get("stringValue").isJsonNull()) && !jsonObj.get("stringValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stringValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stringValue").toString())); + } + if (jsonObj.get("listValue") != null && !jsonObj.get("listValue").isJsonNull()) { + JsonArray jsonArraylistValue = jsonObj.getAsJsonArray("listValue"); + if (jsonArraylistValue != null) { + // ensure the json data is an array + if (!jsonObj.get("listValue").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `listValue` to be an array in the JSON string but got `%s`", jsonObj.get("listValue").toString())); + } + + // validate the optional field `listValue` (array) + for (int i = 0; i < jsonArraylistValue.size(); i++) { + UpdateComparisonValueListModel.validateJsonElement(jsonArraylistValue.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateComparisonValueModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateComparisonValueModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateComparisonValueModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateComparisonValueModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateComparisonValueModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateComparisonValueModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateComparisonValueModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateComparisonValueModel + * @throws IOException if the JSON string is invalid with respect to UpdateComparisonValueModel + */ + public static UpdateComparisonValueModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateComparisonValueModel.class); + } + + /** + * Convert an instance of UpdateComparisonValueModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateConditionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateConditionModel.java new file mode 100644 index 0000000..016d3da --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateConditionModel.java @@ -0,0 +1,363 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.UpdatePrerequisiteFlagConditionModel; +import com.configcat.publicapi.java.client.model.UpdateSegmentConditionModel; +import com.configcat.publicapi.java.client.model.UpdateUserConditionModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateConditionModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateConditionModel { + public static final String SERIALIZED_NAME_USER_CONDITION = "userCondition"; + @SerializedName(SERIALIZED_NAME_USER_CONDITION) + private UpdateUserConditionModel userCondition; + + public static final String SERIALIZED_NAME_SEGMENT_CONDITION = "segmentCondition"; + @SerializedName(SERIALIZED_NAME_SEGMENT_CONDITION) + private UpdateSegmentConditionModel segmentCondition; + + public static final String SERIALIZED_NAME_PREREQUISITE_FLAG_CONDITION = "prerequisiteFlagCondition"; + @SerializedName(SERIALIZED_NAME_PREREQUISITE_FLAG_CONDITION) + private UpdatePrerequisiteFlagConditionModel prerequisiteFlagCondition; + + public UpdateConditionModel() { + } + + public UpdateConditionModel userCondition(UpdateUserConditionModel userCondition) { + this.userCondition = userCondition; + return this; + } + + /** + * Get userCondition + * @return userCondition + */ + @javax.annotation.Nullable + public UpdateUserConditionModel getUserCondition() { + return userCondition; + } + + public void setUserCondition(UpdateUserConditionModel userCondition) { + this.userCondition = userCondition; + } + + + public UpdateConditionModel segmentCondition(UpdateSegmentConditionModel segmentCondition) { + this.segmentCondition = segmentCondition; + return this; + } + + /** + * Get segmentCondition + * @return segmentCondition + */ + @javax.annotation.Nullable + public UpdateSegmentConditionModel getSegmentCondition() { + return segmentCondition; + } + + public void setSegmentCondition(UpdateSegmentConditionModel segmentCondition) { + this.segmentCondition = segmentCondition; + } + + + public UpdateConditionModel prerequisiteFlagCondition(UpdatePrerequisiteFlagConditionModel prerequisiteFlagCondition) { + this.prerequisiteFlagCondition = prerequisiteFlagCondition; + return this; + } + + /** + * Get prerequisiteFlagCondition + * @return prerequisiteFlagCondition + */ + @javax.annotation.Nullable + public UpdatePrerequisiteFlagConditionModel getPrerequisiteFlagCondition() { + return prerequisiteFlagCondition; + } + + public void setPrerequisiteFlagCondition(UpdatePrerequisiteFlagConditionModel prerequisiteFlagCondition) { + this.prerequisiteFlagCondition = prerequisiteFlagCondition; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateConditionModel instance itself + */ + public UpdateConditionModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateConditionModel updateConditionModel = (UpdateConditionModel) o; + return Objects.equals(this.userCondition, updateConditionModel.userCondition) && + Objects.equals(this.segmentCondition, updateConditionModel.segmentCondition) && + Objects.equals(this.prerequisiteFlagCondition, updateConditionModel.prerequisiteFlagCondition)&& + Objects.equals(this.additionalProperties, updateConditionModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(userCondition, segmentCondition, prerequisiteFlagCondition, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateConditionModel {\n"); + sb.append(" userCondition: ").append(toIndentedString(userCondition)).append("\n"); + sb.append(" segmentCondition: ").append(toIndentedString(segmentCondition)).append("\n"); + sb.append(" prerequisiteFlagCondition: ").append(toIndentedString(prerequisiteFlagCondition)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("userCondition"); + openapiFields.add("segmentCondition"); + openapiFields.add("prerequisiteFlagCondition"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateConditionModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateConditionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateConditionModel is not found in the empty JSON string", UpdateConditionModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `userCondition` + if (jsonObj.get("userCondition") != null && !jsonObj.get("userCondition").isJsonNull()) { + UpdateUserConditionModel.validateJsonElement(jsonObj.get("userCondition")); + } + // validate the optional field `segmentCondition` + if (jsonObj.get("segmentCondition") != null && !jsonObj.get("segmentCondition").isJsonNull()) { + UpdateSegmentConditionModel.validateJsonElement(jsonObj.get("segmentCondition")); + } + // validate the optional field `prerequisiteFlagCondition` + if (jsonObj.get("prerequisiteFlagCondition") != null && !jsonObj.get("prerequisiteFlagCondition").isJsonNull()) { + UpdatePrerequisiteFlagConditionModel.validateJsonElement(jsonObj.get("prerequisiteFlagCondition")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateConditionModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateConditionModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateConditionModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateConditionModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateConditionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateConditionModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateConditionModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateConditionModel + * @throws IOException if the JSON string is invalid with respect to UpdateConditionModel + */ + public static UpdateConditionModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateConditionModel.class); + } + + /** + * Convert an instance of UpdateConditionModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateConfigRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateConfigRequest.java index a493157..0782f37 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 @@ -50,7 +50,7 @@ /** * UpdateConfigRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class UpdateConfigRequest { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -111,7 +111,7 @@ public UpdateConfigRequest order(Integer order) { } /** - * The order of the Config represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. + * The order of the Config represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. * @return order */ @javax.annotation.Nullable 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 622daab..7d22a22 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 @@ -50,7 +50,7 @@ /** * UpdateEnvironmentModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class UpdateEnvironmentModel { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -134,7 +134,7 @@ public UpdateEnvironmentModel order(Integer order) { } /** - * The order of the Environment represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. + * The order of the Environment represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. * @return order */ @javax.annotation.Nullable 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 8f0421a..a84dac2 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 @@ -14,8 +14,8 @@ 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.configcat.publicapi.java.client.model.UpdateTargetingRuleModel; +import com.configcat.publicapi.java.client.model.UpdateValueModel; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -54,15 +54,15 @@ /** * UpdateEvaluationFormulaModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class UpdateEvaluationFormulaModel { public static final String SERIALIZED_NAME_DEFAULT_VALUE = "defaultValue"; @SerializedName(SERIALIZED_NAME_DEFAULT_VALUE) - private ValueModel defaultValue; + private UpdateValueModel defaultValue; public static final String SERIALIZED_NAME_TARGETING_RULES = "targetingRules"; @SerializedName(SERIALIZED_NAME_TARGETING_RULES) - private List targetingRules; + private List targetingRules; public static final String SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE = "percentageEvaluationAttribute"; @SerializedName(SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE) @@ -71,7 +71,7 @@ public class UpdateEvaluationFormulaModel { public UpdateEvaluationFormulaModel() { } - public UpdateEvaluationFormulaModel defaultValue(ValueModel defaultValue) { + public UpdateEvaluationFormulaModel defaultValue(UpdateValueModel defaultValue) { this.defaultValue = defaultValue; return this; } @@ -81,21 +81,21 @@ public UpdateEvaluationFormulaModel defaultValue(ValueModel defaultValue) { * @return defaultValue */ @javax.annotation.Nonnull - public ValueModel getDefaultValue() { + public UpdateValueModel getDefaultValue() { return defaultValue; } - public void setDefaultValue(ValueModel defaultValue) { + public void setDefaultValue(UpdateValueModel defaultValue) { this.defaultValue = defaultValue; } - public UpdateEvaluationFormulaModel targetingRules(List targetingRules) { + public UpdateEvaluationFormulaModel targetingRules(List targetingRules) { this.targetingRules = targetingRules; return this; } - public UpdateEvaluationFormulaModel addTargetingRulesItem(TargetingRuleModel targetingRulesItem) { + public UpdateEvaluationFormulaModel addTargetingRulesItem(UpdateTargetingRuleModel targetingRulesItem) { if (this.targetingRules == null) { this.targetingRules = new ArrayList<>(); } @@ -108,11 +108,11 @@ public UpdateEvaluationFormulaModel addTargetingRulesItem(TargetingRuleModel tar * @return targetingRules */ @javax.annotation.Nullable - public List getTargetingRules() { + public List getTargetingRules() { return targetingRules; } - public void setTargetingRules(List targetingRules) { + public void setTargetingRules(List targetingRules) { this.targetingRules = targetingRules; } @@ -272,7 +272,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `defaultValue` - ValueModel.validateJsonElement(jsonObj.get("defaultValue")); + UpdateValueModel.validateJsonElement(jsonObj.get("defaultValue")); if (jsonObj.get("targetingRules") != null && !jsonObj.get("targetingRules").isJsonNull()) { JsonArray jsonArraytargetingRules = jsonObj.getAsJsonArray("targetingRules"); if (jsonArraytargetingRules != null) { @@ -283,7 +283,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `targetingRules` (array) for (int i = 0; i < jsonArraytargetingRules.size(); i++) { - TargetingRuleModel.validateJsonElement(jsonArraytargetingRules.get(i)); + UpdateTargetingRuleModel.validateJsonElement(jsonArraytargetingRules.get(i)); }; } } 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 1cdd9af..aaba22e 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 @@ -14,8 +14,8 @@ 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.configcat.publicapi.java.client.model.UpdateTargetingRuleModel; +import com.configcat.publicapi.java.client.model.UpdateValueModel; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -54,15 +54,15 @@ /** * UpdateEvaluationFormulaWithIdModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class UpdateEvaluationFormulaWithIdModel { public static final String SERIALIZED_NAME_DEFAULT_VALUE = "defaultValue"; @SerializedName(SERIALIZED_NAME_DEFAULT_VALUE) - private ValueModel defaultValue; + private UpdateValueModel defaultValue; public static final String SERIALIZED_NAME_TARGETING_RULES = "targetingRules"; @SerializedName(SERIALIZED_NAME_TARGETING_RULES) - private List targetingRules; + private List targetingRules; public static final String SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE = "percentageEvaluationAttribute"; @SerializedName(SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE) @@ -75,7 +75,7 @@ public class UpdateEvaluationFormulaWithIdModel { public UpdateEvaluationFormulaWithIdModel() { } - public UpdateEvaluationFormulaWithIdModel defaultValue(ValueModel defaultValue) { + public UpdateEvaluationFormulaWithIdModel defaultValue(UpdateValueModel defaultValue) { this.defaultValue = defaultValue; return this; } @@ -85,21 +85,21 @@ public UpdateEvaluationFormulaWithIdModel defaultValue(ValueModel defaultValue) * @return defaultValue */ @javax.annotation.Nonnull - public ValueModel getDefaultValue() { + public UpdateValueModel getDefaultValue() { return defaultValue; } - public void setDefaultValue(ValueModel defaultValue) { + public void setDefaultValue(UpdateValueModel defaultValue) { this.defaultValue = defaultValue; } - public UpdateEvaluationFormulaWithIdModel targetingRules(List targetingRules) { + public UpdateEvaluationFormulaWithIdModel targetingRules(List targetingRules) { this.targetingRules = targetingRules; return this; } - public UpdateEvaluationFormulaWithIdModel addTargetingRulesItem(TargetingRuleModel targetingRulesItem) { + public UpdateEvaluationFormulaWithIdModel addTargetingRulesItem(UpdateTargetingRuleModel targetingRulesItem) { if (this.targetingRules == null) { this.targetingRules = new ArrayList<>(); } @@ -112,11 +112,11 @@ public UpdateEvaluationFormulaWithIdModel addTargetingRulesItem(TargetingRuleMod * @return targetingRules */ @javax.annotation.Nullable - public List getTargetingRules() { + public List getTargetingRules() { return targetingRules; } - public void setTargetingRules(List targetingRules) { + public void setTargetingRules(List targetingRules) { this.targetingRules = targetingRules; } @@ -298,7 +298,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `defaultValue` - ValueModel.validateJsonElement(jsonObj.get("defaultValue")); + UpdateValueModel.validateJsonElement(jsonObj.get("defaultValue")); if (jsonObj.get("targetingRules") != null && !jsonObj.get("targetingRules").isJsonNull()) { JsonArray jsonArraytargetingRules = jsonObj.getAsJsonArray("targetingRules"); if (jsonArraytargetingRules != null) { @@ -309,7 +309,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `targetingRules` (array) for (int i = 0; i < jsonArraytargetingRules.size(); i++) { - TargetingRuleModel.validateJsonElement(jsonArraytargetingRules.get(i)); + UpdateTargetingRuleModel.validateJsonElement(jsonArraytargetingRules.get(i)); }; } } 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 1e0b555..854ede4 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 @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -53,11 +52,11 @@ /** * UpdateEvaluationFormulasModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class UpdateEvaluationFormulasModel { public static final String SERIALIZED_NAME_UPDATE_FORMULAS = "updateFormulas"; @SerializedName(SERIALIZED_NAME_UPDATE_FORMULAS) - private List updateFormulas; + private List updateFormulas = new ArrayList<>(); public UpdateEvaluationFormulasModel() { } @@ -147,22 +146,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, updateEvaluationFormulasModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(updateFormulas, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 4689ab5..17ddb98 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 @@ -52,7 +52,7 @@ /** * UpdateMemberPermissionsRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class UpdateMemberPermissionsRequest { public static final String SERIALIZED_NAME_PERMISSION_GROUP_IDS = "permissionGroupIds"; @SerializedName(SERIALIZED_NAME_PERMISSION_GROUP_IDS) diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdatePercentageOptionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdatePercentageOptionModel.java new file mode 100644 index 0000000..b010a1a --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdatePercentageOptionModel.java @@ -0,0 +1,322 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.UpdateValueModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdatePercentageOptionModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdatePercentageOptionModel { + public static final String SERIALIZED_NAME_PERCENTAGE = "percentage"; + @SerializedName(SERIALIZED_NAME_PERCENTAGE) + private Integer percentage; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private UpdateValueModel value; + + public UpdatePercentageOptionModel() { + } + + public UpdatePercentageOptionModel percentage(Integer percentage) { + this.percentage = percentage; + return this; + } + + /** + * A number between 0 and 100 that represents a randomly allocated fraction of the users. + * @return percentage + */ + @javax.annotation.Nonnull + public Integer getPercentage() { + return percentage; + } + + public void setPercentage(Integer percentage) { + this.percentage = percentage; + } + + + public UpdatePercentageOptionModel value(UpdateValueModel value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nonnull + public UpdateValueModel getValue() { + return value; + } + + public void setValue(UpdateValueModel value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdatePercentageOptionModel instance itself + */ + public UpdatePercentageOptionModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePercentageOptionModel updatePercentageOptionModel = (UpdatePercentageOptionModel) o; + return Objects.equals(this.percentage, updatePercentageOptionModel.percentage) && + Objects.equals(this.value, updatePercentageOptionModel.value)&& + Objects.equals(this.additionalProperties, updatePercentageOptionModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(percentage, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdatePercentageOptionModel {\n"); + sb.append(" percentage: ").append(toIndentedString(percentage)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("percentage"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("percentage"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdatePercentageOptionModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdatePercentageOptionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdatePercentageOptionModel is not found in the empty JSON string", UpdatePercentageOptionModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdatePercentageOptionModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `value` + UpdateValueModel.validateJsonElement(jsonObj.get("value")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdatePercentageOptionModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdatePercentageOptionModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdatePercentageOptionModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdatePercentageOptionModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdatePercentageOptionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdatePercentageOptionModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdatePercentageOptionModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdatePercentageOptionModel + * @throws IOException if the JSON string is invalid with respect to UpdatePercentageOptionModel + */ + public static UpdatePercentageOptionModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdatePercentageOptionModel.class); + } + + /** + * Convert an instance of UpdatePercentageOptionModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdatePermissionGroupRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdatePermissionGroupRequest.java index 459ffb5..9ec7a05 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 @@ -55,7 +55,7 @@ /** * UpdatePermissionGroupRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class UpdatePermissionGroupRequest { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) 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 1a1c2f4..bc7515c 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 @@ -54,7 +54,7 @@ /** * UpdatePreferencesRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class UpdatePreferencesRequest { public static final String SERIALIZED_NAME_REASON_REQUIRED = "reasonRequired"; @SerializedName(SERIALIZED_NAME_REASON_REQUIRED) diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdatePrerequisiteFlagConditionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdatePrerequisiteFlagConditionModel.java new file mode 100644 index 0000000..6ed53f3 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdatePrerequisiteFlagConditionModel.java @@ -0,0 +1,352 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.PrerequisiteComparator; +import com.configcat.publicapi.java.client.model.UpdateValueModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Describes a condition that is based on a prerequisite flag. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdatePrerequisiteFlagConditionModel { + public static final String SERIALIZED_NAME_PREREQUISITE_SETTING_ID = "prerequisiteSettingId"; + @SerializedName(SERIALIZED_NAME_PREREQUISITE_SETTING_ID) + private Integer prerequisiteSettingId; + + public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; + @SerializedName(SERIALIZED_NAME_COMPARATOR) + private PrerequisiteComparator comparator; + + public static final String SERIALIZED_NAME_PREREQUISITE_COMPARISON_VALUE = "prerequisiteComparisonValue"; + @SerializedName(SERIALIZED_NAME_PREREQUISITE_COMPARISON_VALUE) + private UpdateValueModel prerequisiteComparisonValue; + + public UpdatePrerequisiteFlagConditionModel() { + } + + public UpdatePrerequisiteFlagConditionModel prerequisiteSettingId(Integer prerequisiteSettingId) { + this.prerequisiteSettingId = prerequisiteSettingId; + return this; + } + + /** + * The prerequisite flag's identifier. + * @return prerequisiteSettingId + */ + @javax.annotation.Nonnull + public Integer getPrerequisiteSettingId() { + return prerequisiteSettingId; + } + + public void setPrerequisiteSettingId(Integer prerequisiteSettingId) { + this.prerequisiteSettingId = prerequisiteSettingId; + } + + + public UpdatePrerequisiteFlagConditionModel comparator(PrerequisiteComparator comparator) { + this.comparator = comparator; + return this; + } + + /** + * Get comparator + * @return comparator + */ + @javax.annotation.Nonnull + public PrerequisiteComparator getComparator() { + return comparator; + } + + public void setComparator(PrerequisiteComparator comparator) { + this.comparator = comparator; + } + + + public UpdatePrerequisiteFlagConditionModel prerequisiteComparisonValue(UpdateValueModel prerequisiteComparisonValue) { + this.prerequisiteComparisonValue = prerequisiteComparisonValue; + return this; + } + + /** + * Get prerequisiteComparisonValue + * @return prerequisiteComparisonValue + */ + @javax.annotation.Nonnull + public UpdateValueModel getPrerequisiteComparisonValue() { + return prerequisiteComparisonValue; + } + + public void setPrerequisiteComparisonValue(UpdateValueModel prerequisiteComparisonValue) { + this.prerequisiteComparisonValue = prerequisiteComparisonValue; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdatePrerequisiteFlagConditionModel instance itself + */ + public UpdatePrerequisiteFlagConditionModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePrerequisiteFlagConditionModel updatePrerequisiteFlagConditionModel = (UpdatePrerequisiteFlagConditionModel) o; + return Objects.equals(this.prerequisiteSettingId, updatePrerequisiteFlagConditionModel.prerequisiteSettingId) && + Objects.equals(this.comparator, updatePrerequisiteFlagConditionModel.comparator) && + Objects.equals(this.prerequisiteComparisonValue, updatePrerequisiteFlagConditionModel.prerequisiteComparisonValue)&& + Objects.equals(this.additionalProperties, updatePrerequisiteFlagConditionModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(prerequisiteSettingId, comparator, prerequisiteComparisonValue, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdatePrerequisiteFlagConditionModel {\n"); + sb.append(" prerequisiteSettingId: ").append(toIndentedString(prerequisiteSettingId)).append("\n"); + sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); + sb.append(" prerequisiteComparisonValue: ").append(toIndentedString(prerequisiteComparisonValue)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("prerequisiteSettingId"); + openapiFields.add("comparator"); + openapiFields.add("prerequisiteComparisonValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("prerequisiteSettingId"); + openapiRequiredFields.add("comparator"); + openapiRequiredFields.add("prerequisiteComparisonValue"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdatePrerequisiteFlagConditionModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdatePrerequisiteFlagConditionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdatePrerequisiteFlagConditionModel is not found in the empty JSON string", UpdatePrerequisiteFlagConditionModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdatePrerequisiteFlagConditionModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `comparator` + PrerequisiteComparator.validateJsonElement(jsonObj.get("comparator")); + // validate the required field `prerequisiteComparisonValue` + UpdateValueModel.validateJsonElement(jsonObj.get("prerequisiteComparisonValue")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdatePrerequisiteFlagConditionModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdatePrerequisiteFlagConditionModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdatePrerequisiteFlagConditionModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdatePrerequisiteFlagConditionModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdatePrerequisiteFlagConditionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdatePrerequisiteFlagConditionModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdatePrerequisiteFlagConditionModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdatePrerequisiteFlagConditionModel + * @throws IOException if the JSON string is invalid with respect to UpdatePrerequisiteFlagConditionModel + */ + public static UpdatePrerequisiteFlagConditionModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdatePrerequisiteFlagConditionModel.class); + } + + /** + * Convert an instance of UpdatePrerequisiteFlagConditionModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateProductRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateProductRequest.java index 424e70f..665e48a 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 @@ -50,7 +50,7 @@ /** * UpdateProductRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class UpdateProductRequest { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -111,7 +111,7 @@ public UpdateProductRequest order(Integer order) { } /** - * The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. + * The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. * @return order */ @javax.annotation.Nullable 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 1a5a906..f7fec1c 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 @@ -50,7 +50,7 @@ /** * UpdateReasonRequiredEnvironmentModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class UpdateReasonRequiredEnvironmentModel { public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateRolloutPercentageItemModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateRolloutPercentageItemModel.java new file mode 100644 index 0000000..a3a5196 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateRolloutPercentageItemModel.java @@ -0,0 +1,322 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.SettingValueType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateRolloutPercentageItemModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateRolloutPercentageItemModel { + public static final String SERIALIZED_NAME_PERCENTAGE = "percentage"; + @SerializedName(SERIALIZED_NAME_PERCENTAGE) + private Long percentage; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private SettingValueType value; + + public UpdateRolloutPercentageItemModel() { + } + + public UpdateRolloutPercentageItemModel percentage(Long percentage) { + this.percentage = percentage; + return this; + } + + /** + * The percentage value for the rule. + * @return percentage + */ + @javax.annotation.Nonnull + public Long getPercentage() { + return percentage; + } + + public void setPercentage(Long percentage) { + this.percentage = percentage; + } + + + public UpdateRolloutPercentageItemModel value(SettingValueType value) { + this.value = value; + return this; + } + + /** + * The value to serve when the user falls in the percentage rule. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. + * @return value + */ + @javax.annotation.Nonnull + public SettingValueType getValue() { + return value; + } + + public void setValue(SettingValueType value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateRolloutPercentageItemModel instance itself + */ + public UpdateRolloutPercentageItemModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateRolloutPercentageItemModel updateRolloutPercentageItemModel = (UpdateRolloutPercentageItemModel) o; + return Objects.equals(this.percentage, updateRolloutPercentageItemModel.percentage) && + Objects.equals(this.value, updateRolloutPercentageItemModel.value)&& + Objects.equals(this.additionalProperties, updateRolloutPercentageItemModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(percentage, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateRolloutPercentageItemModel {\n"); + sb.append(" percentage: ").append(toIndentedString(percentage)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("percentage"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("percentage"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateRolloutPercentageItemModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateRolloutPercentageItemModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateRolloutPercentageItemModel is not found in the empty JSON string", UpdateRolloutPercentageItemModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateRolloutPercentageItemModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `value` + SettingValueType.validateJsonElement(jsonObj.get("value")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateRolloutPercentageItemModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateRolloutPercentageItemModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateRolloutPercentageItemModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateRolloutPercentageItemModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateRolloutPercentageItemModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateRolloutPercentageItemModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateRolloutPercentageItemModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateRolloutPercentageItemModel + * @throws IOException if the JSON string is invalid with respect to UpdateRolloutPercentageItemModel + */ + public static UpdateRolloutPercentageItemModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateRolloutPercentageItemModel.class); + } + + /** + * Convert an instance of UpdateRolloutPercentageItemModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateRolloutRuleModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateRolloutRuleModel.java new file mode 100644 index 0000000..2ca2bac --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateRolloutRuleModel.java @@ -0,0 +1,457 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.RolloutRuleComparator; +import com.configcat.publicapi.java.client.model.SegmentComparator; +import com.configcat.publicapi.java.client.model.SettingValueType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateRolloutRuleModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateRolloutRuleModel { + public static final String SERIALIZED_NAME_COMPARISON_ATTRIBUTE = "comparisonAttribute"; + @SerializedName(SERIALIZED_NAME_COMPARISON_ATTRIBUTE) + private String comparisonAttribute; + + public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; + @SerializedName(SERIALIZED_NAME_COMPARATOR) + private RolloutRuleComparator comparator; + + public static final String SERIALIZED_NAME_COMPARISON_VALUE = "comparisonValue"; + @SerializedName(SERIALIZED_NAME_COMPARISON_VALUE) + private String comparisonValue; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private SettingValueType value; + + public static final String SERIALIZED_NAME_SEGMENT_COMPARATOR = "segmentComparator"; + @SerializedName(SERIALIZED_NAME_SEGMENT_COMPARATOR) + private SegmentComparator segmentComparator; + + public static final String SERIALIZED_NAME_SEGMENT_ID = "segmentId"; + @SerializedName(SERIALIZED_NAME_SEGMENT_ID) + private UUID segmentId; + + public UpdateRolloutRuleModel() { + } + + public UpdateRolloutRuleModel comparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; + return this; + } + + /** + * The user attribute to compare. + * @return comparisonAttribute + */ + @javax.annotation.Nullable + public String getComparisonAttribute() { + return comparisonAttribute; + } + + public void setComparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; + } + + + public UpdateRolloutRuleModel comparator(RolloutRuleComparator comparator) { + this.comparator = comparator; + return this; + } + + /** + * Get comparator + * @return comparator + */ + @javax.annotation.Nullable + public RolloutRuleComparator getComparator() { + return comparator; + } + + public void setComparator(RolloutRuleComparator comparator) { + this.comparator = comparator; + } + + + public UpdateRolloutRuleModel comparisonValue(String comparisonValue) { + this.comparisonValue = comparisonValue; + return this; + } + + /** + * The value to compare against. + * @return comparisonValue + */ + @javax.annotation.Nullable + public String getComparisonValue() { + return comparisonValue; + } + + public void setComparisonValue(String comparisonValue) { + this.comparisonValue = comparisonValue; + } + + + public UpdateRolloutRuleModel value(SettingValueType value) { + this.value = value; + return this; + } + + /** + * The value to serve when the comparison matches. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. + * @return value + */ + @javax.annotation.Nonnull + public SettingValueType getValue() { + return value; + } + + public void setValue(SettingValueType value) { + this.value = value; + } + + + public UpdateRolloutRuleModel segmentComparator(SegmentComparator segmentComparator) { + this.segmentComparator = segmentComparator; + return this; + } + + /** + * Get segmentComparator + * @return segmentComparator + */ + @javax.annotation.Nullable + public SegmentComparator getSegmentComparator() { + return segmentComparator; + } + + public void setSegmentComparator(SegmentComparator segmentComparator) { + this.segmentComparator = segmentComparator; + } + + + public UpdateRolloutRuleModel segmentId(UUID segmentId) { + this.segmentId = segmentId; + return this; + } + + /** + * The segment to compare against. + * @return segmentId + */ + @javax.annotation.Nullable + public UUID getSegmentId() { + return segmentId; + } + + public void setSegmentId(UUID segmentId) { + this.segmentId = segmentId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateRolloutRuleModel instance itself + */ + public UpdateRolloutRuleModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateRolloutRuleModel updateRolloutRuleModel = (UpdateRolloutRuleModel) o; + return Objects.equals(this.comparisonAttribute, updateRolloutRuleModel.comparisonAttribute) && + Objects.equals(this.comparator, updateRolloutRuleModel.comparator) && + Objects.equals(this.comparisonValue, updateRolloutRuleModel.comparisonValue) && + Objects.equals(this.value, updateRolloutRuleModel.value) && + Objects.equals(this.segmentComparator, updateRolloutRuleModel.segmentComparator) && + Objects.equals(this.segmentId, updateRolloutRuleModel.segmentId)&& + Objects.equals(this.additionalProperties, updateRolloutRuleModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(comparisonAttribute, comparator, comparisonValue, value, segmentComparator, segmentId, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateRolloutRuleModel {\n"); + sb.append(" comparisonAttribute: ").append(toIndentedString(comparisonAttribute)).append("\n"); + sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); + sb.append(" comparisonValue: ").append(toIndentedString(comparisonValue)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" segmentComparator: ").append(toIndentedString(segmentComparator)).append("\n"); + sb.append(" segmentId: ").append(toIndentedString(segmentId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("comparisonAttribute"); + openapiFields.add("comparator"); + openapiFields.add("comparisonValue"); + openapiFields.add("value"); + openapiFields.add("segmentComparator"); + openapiFields.add("segmentId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateRolloutRuleModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateRolloutRuleModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateRolloutRuleModel is not found in the empty JSON string", UpdateRolloutRuleModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateRolloutRuleModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("comparisonAttribute") != null && !jsonObj.get("comparisonAttribute").isJsonNull()) && !jsonObj.get("comparisonAttribute").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `comparisonAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonAttribute").toString())); + } + // validate the optional field `comparator` + if (jsonObj.get("comparator") != null && !jsonObj.get("comparator").isJsonNull()) { + RolloutRuleComparator.validateJsonElement(jsonObj.get("comparator")); + } + if ((jsonObj.get("comparisonValue") != null && !jsonObj.get("comparisonValue").isJsonNull()) && !jsonObj.get("comparisonValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `comparisonValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonValue").toString())); + } + // validate the required field `value` + SettingValueType.validateJsonElement(jsonObj.get("value")); + // validate the optional field `segmentComparator` + if (jsonObj.get("segmentComparator") != null && !jsonObj.get("segmentComparator").isJsonNull()) { + SegmentComparator.validateJsonElement(jsonObj.get("segmentComparator")); + } + if ((jsonObj.get("segmentId") != null && !jsonObj.get("segmentId").isJsonNull()) && !jsonObj.get("segmentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `segmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("segmentId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateRolloutRuleModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateRolloutRuleModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateRolloutRuleModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateRolloutRuleModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateRolloutRuleModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateRolloutRuleModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateRolloutRuleModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateRolloutRuleModel + * @throws IOException if the JSON string is invalid with respect to UpdateRolloutRuleModel + */ + public static UpdateRolloutRuleModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateRolloutRuleModel.class); + } + + /** + * Convert an instance of UpdateRolloutRuleModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentConditionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentConditionModel.java new file mode 100644 index 0000000..fde91c6 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentConditionModel.java @@ -0,0 +1,326 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.SegmentComparator; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Describes a condition that is based on a segment. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateSegmentConditionModel { + public static final String SERIALIZED_NAME_SEGMENT_ID = "segmentId"; + @SerializedName(SERIALIZED_NAME_SEGMENT_ID) + private UUID segmentId; + + public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; + @SerializedName(SERIALIZED_NAME_COMPARATOR) + private SegmentComparator comparator; + + public UpdateSegmentConditionModel() { + } + + public UpdateSegmentConditionModel segmentId(UUID segmentId) { + this.segmentId = segmentId; + return this; + } + + /** + * The segment's identifier. + * @return segmentId + */ + @javax.annotation.Nonnull + public UUID getSegmentId() { + return segmentId; + } + + public void setSegmentId(UUID segmentId) { + this.segmentId = segmentId; + } + + + public UpdateSegmentConditionModel comparator(SegmentComparator comparator) { + this.comparator = comparator; + return this; + } + + /** + * Get comparator + * @return comparator + */ + @javax.annotation.Nonnull + public SegmentComparator getComparator() { + return comparator; + } + + public void setComparator(SegmentComparator comparator) { + this.comparator = comparator; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateSegmentConditionModel instance itself + */ + public UpdateSegmentConditionModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSegmentConditionModel updateSegmentConditionModel = (UpdateSegmentConditionModel) o; + return Objects.equals(this.segmentId, updateSegmentConditionModel.segmentId) && + Objects.equals(this.comparator, updateSegmentConditionModel.comparator)&& + Objects.equals(this.additionalProperties, updateSegmentConditionModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(segmentId, comparator, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSegmentConditionModel {\n"); + sb.append(" segmentId: ").append(toIndentedString(segmentId)).append("\n"); + sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("segmentId"); + openapiFields.add("comparator"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("segmentId"); + openapiRequiredFields.add("comparator"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateSegmentConditionModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateSegmentConditionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateSegmentConditionModel is not found in the empty JSON string", UpdateSegmentConditionModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateSegmentConditionModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("segmentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `segmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("segmentId").toString())); + } + // validate the required field `comparator` + SegmentComparator.validateJsonElement(jsonObj.get("comparator")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateSegmentConditionModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateSegmentConditionModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateSegmentConditionModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateSegmentConditionModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateSegmentConditionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateSegmentConditionModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateSegmentConditionModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateSegmentConditionModel + * @throws IOException if the JSON string is invalid with respect to UpdateSegmentConditionModel + */ + public static UpdateSegmentConditionModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateSegmentConditionModel.class); + } + + /** + * Convert an instance of UpdateSegmentConditionModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentModel.java index af597ba..468c9d7 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 @@ -51,7 +51,7 @@ /** * UpdateSegmentModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class UpdateSegmentModel { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) 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 4164fb8..6ba0494 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 @@ -14,8 +14,9 @@ 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.configcat.publicapi.java.client.model.SettingValueType; +import com.configcat.publicapi.java.client.model.UpdateRolloutPercentageItemModel; +import com.configcat.publicapi.java.client.model.UpdateRolloutRuleModel; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -25,7 +26,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -54,29 +54,29 @@ /** * UpdateSettingValueModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class UpdateSettingValueModel { public static final String SERIALIZED_NAME_ROLLOUT_RULES = "rolloutRules"; @SerializedName(SERIALIZED_NAME_ROLLOUT_RULES) - private List rolloutRules; + private List rolloutRules = new ArrayList<>(); public static final String SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS = "rolloutPercentageItems"; @SerializedName(SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS) - private List rolloutPercentageItems; + private List rolloutPercentageItems = new ArrayList<>(); public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) - private Object value = null; + private SettingValueType value; public UpdateSettingValueModel() { } - public UpdateSettingValueModel rolloutRules(List rolloutRules) { + public UpdateSettingValueModel rolloutRules(List rolloutRules) { this.rolloutRules = rolloutRules; return this; } - public UpdateSettingValueModel addRolloutRulesItem(RolloutRuleModel rolloutRulesItem) { + public UpdateSettingValueModel addRolloutRulesItem(UpdateRolloutRuleModel rolloutRulesItem) { if (this.rolloutRules == null) { this.rolloutRules = new ArrayList<>(); } @@ -89,21 +89,21 @@ public UpdateSettingValueModel addRolloutRulesItem(RolloutRuleModel rolloutRules * @return rolloutRules */ @javax.annotation.Nullable - public List getRolloutRules() { + public List getRolloutRules() { return rolloutRules; } - public void setRolloutRules(List rolloutRules) { + public void setRolloutRules(List rolloutRules) { this.rolloutRules = rolloutRules; } - public UpdateSettingValueModel rolloutPercentageItems(List rolloutPercentageItems) { + public UpdateSettingValueModel rolloutPercentageItems(List rolloutPercentageItems) { this.rolloutPercentageItems = rolloutPercentageItems; return this; } - public UpdateSettingValueModel addRolloutPercentageItemsItem(RolloutPercentageItemModel rolloutPercentageItemsItem) { + public UpdateSettingValueModel addRolloutPercentageItemsItem(UpdateRolloutPercentageItemModel rolloutPercentageItemsItem) { if (this.rolloutPercentageItems == null) { this.rolloutPercentageItems = new ArrayList<>(); } @@ -116,30 +116,30 @@ public UpdateSettingValueModel addRolloutPercentageItemsItem(RolloutPercentageIt * @return rolloutPercentageItems */ @javax.annotation.Nullable - public List getRolloutPercentageItems() { + public List getRolloutPercentageItems() { return rolloutPercentageItems; } - public void setRolloutPercentageItems(List rolloutPercentageItems) { + public void setRolloutPercentageItems(List rolloutPercentageItems) { this.rolloutPercentageItems = rolloutPercentageItems; } - public UpdateSettingValueModel value(Object value) { + public UpdateSettingValueModel value(SettingValueType value) { this.value = value; return this; } /** - * The value to serve. It must respect the setting type. + * The value to serve. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. * @return value */ - @javax.annotation.Nullable - public Object getValue() { + @javax.annotation.Nonnull + public SettingValueType getValue() { return value; } - public void setValue(Object value) { + public void setValue(SettingValueType value) { this.value = value; } @@ -204,22 +204,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, updateSettingValueModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(rolloutRules, rolloutPercentageItems, value, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -256,6 +245,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("value"); } /** @@ -270,6 +260,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateSettingValueModel is not found in the empty JSON string", UpdateSettingValueModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateSettingValueModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("rolloutRules") != null && !jsonObj.get("rolloutRules").isJsonNull()) { JsonArray jsonArrayrolloutRules = jsonObj.getAsJsonArray("rolloutRules"); @@ -281,7 +278,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `rolloutRules` (array) for (int i = 0; i < jsonArrayrolloutRules.size(); i++) { - RolloutRuleModel.validateJsonElement(jsonArrayrolloutRules.get(i)); + UpdateRolloutRuleModel.validateJsonElement(jsonArrayrolloutRules.get(i)); }; } } @@ -295,10 +292,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `rolloutPercentageItems` (array) for (int i = 0; i < jsonArrayrolloutPercentageItems.size(); i++) { - RolloutPercentageItemModel.validateJsonElement(jsonArrayrolloutPercentageItems.get(i)); + UpdateRolloutPercentageItemModel.validateJsonElement(jsonArrayrolloutPercentageItems.get(i)); }; } } + // validate the required field `value` + SettingValueType.validateJsonElement(jsonObj.get("value")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 6a256f9..bb5bcdb 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 @@ -14,8 +14,9 @@ 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.configcat.publicapi.java.client.model.SettingValueType; +import com.configcat.publicapi.java.client.model.UpdateRolloutPercentageItemModel; +import com.configcat.publicapi.java.client.model.UpdateRolloutRuleModel; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -25,7 +26,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -54,19 +54,19 @@ /** * UpdateSettingValueWithSettingIdModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class UpdateSettingValueWithSettingIdModel { public static final String SERIALIZED_NAME_ROLLOUT_RULES = "rolloutRules"; @SerializedName(SERIALIZED_NAME_ROLLOUT_RULES) - private List rolloutRules; + private List rolloutRules = new ArrayList<>(); public static final String SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS = "rolloutPercentageItems"; @SerializedName(SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS) - private List rolloutPercentageItems; + private List rolloutPercentageItems = new ArrayList<>(); public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) - private Object value = null; + private SettingValueType value; public static final String SERIALIZED_NAME_SETTING_ID = "settingId"; @SerializedName(SERIALIZED_NAME_SETTING_ID) @@ -75,12 +75,12 @@ public class UpdateSettingValueWithSettingIdModel { public UpdateSettingValueWithSettingIdModel() { } - public UpdateSettingValueWithSettingIdModel rolloutRules(List rolloutRules) { + public UpdateSettingValueWithSettingIdModel rolloutRules(List rolloutRules) { this.rolloutRules = rolloutRules; return this; } - public UpdateSettingValueWithSettingIdModel addRolloutRulesItem(RolloutRuleModel rolloutRulesItem) { + public UpdateSettingValueWithSettingIdModel addRolloutRulesItem(UpdateRolloutRuleModel rolloutRulesItem) { if (this.rolloutRules == null) { this.rolloutRules = new ArrayList<>(); } @@ -93,21 +93,21 @@ public UpdateSettingValueWithSettingIdModel addRolloutRulesItem(RolloutRuleModel * @return rolloutRules */ @javax.annotation.Nullable - public List getRolloutRules() { + public List getRolloutRules() { return rolloutRules; } - public void setRolloutRules(List rolloutRules) { + public void setRolloutRules(List rolloutRules) { this.rolloutRules = rolloutRules; } - public UpdateSettingValueWithSettingIdModel rolloutPercentageItems(List rolloutPercentageItems) { + public UpdateSettingValueWithSettingIdModel rolloutPercentageItems(List rolloutPercentageItems) { this.rolloutPercentageItems = rolloutPercentageItems; return this; } - public UpdateSettingValueWithSettingIdModel addRolloutPercentageItemsItem(RolloutPercentageItemModel rolloutPercentageItemsItem) { + public UpdateSettingValueWithSettingIdModel addRolloutPercentageItemsItem(UpdateRolloutPercentageItemModel rolloutPercentageItemsItem) { if (this.rolloutPercentageItems == null) { this.rolloutPercentageItems = new ArrayList<>(); } @@ -120,30 +120,30 @@ public UpdateSettingValueWithSettingIdModel addRolloutPercentageItemsItem(Rollou * @return rolloutPercentageItems */ @javax.annotation.Nullable - public List getRolloutPercentageItems() { + public List getRolloutPercentageItems() { return rolloutPercentageItems; } - public void setRolloutPercentageItems(List rolloutPercentageItems) { + public void setRolloutPercentageItems(List rolloutPercentageItems) { this.rolloutPercentageItems = rolloutPercentageItems; } - public UpdateSettingValueWithSettingIdModel value(Object value) { + public UpdateSettingValueWithSettingIdModel value(SettingValueType value) { this.value = value; return this; } /** - * The value to serve. It must respect the setting type. + * The value to serve. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. * @return value */ - @javax.annotation.Nullable - public Object getValue() { + @javax.annotation.Nonnull + public SettingValueType getValue() { return value; } - public void setValue(Object value) { + public void setValue(SettingValueType value) { this.value = value; } @@ -228,22 +228,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, updateSettingValueWithSettingIdModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(rolloutRules, rolloutPercentageItems, value, settingId, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -282,6 +271,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("value"); } /** @@ -296,6 +286,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateSettingValueWithSettingIdModel is not found in the empty JSON string", UpdateSettingValueWithSettingIdModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateSettingValueWithSettingIdModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("rolloutRules") != null && !jsonObj.get("rolloutRules").isJsonNull()) { JsonArray jsonArrayrolloutRules = jsonObj.getAsJsonArray("rolloutRules"); @@ -307,7 +304,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `rolloutRules` (array) for (int i = 0; i < jsonArrayrolloutRules.size(); i++) { - RolloutRuleModel.validateJsonElement(jsonArrayrolloutRules.get(i)); + UpdateRolloutRuleModel.validateJsonElement(jsonArrayrolloutRules.get(i)); }; } } @@ -321,10 +318,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `rolloutPercentageItems` (array) for (int i = 0; i < jsonArrayrolloutPercentageItems.size(); i++) { - RolloutPercentageItemModel.validateJsonElement(jsonArrayrolloutPercentageItems.get(i)); + UpdateRolloutPercentageItemModel.validateJsonElement(jsonArrayrolloutPercentageItems.get(i)); }; } } + // validate the required field `value` + SettingValueType.validateJsonElement(jsonObj.get("value")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 5ae1294..d690880 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 @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -53,11 +52,11 @@ /** * UpdateSettingValuesWithIdModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class UpdateSettingValuesWithIdModel { public static final String SERIALIZED_NAME_SETTING_VALUES = "settingValues"; @SerializedName(SERIALIZED_NAME_SETTING_VALUES) - private List settingValues; + private List settingValues = new ArrayList<>(); public UpdateSettingValuesWithIdModel() { } @@ -147,22 +146,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, updateSettingValuesWithIdModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(settingValues, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 45d5895..7919e3c 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 @@ -50,7 +50,7 @@ /** * UpdateTagModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class UpdateTagModel { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateTargetingRuleModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateTargetingRuleModel.java new file mode 100644 index 0000000..7fe0089 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateTargetingRuleModel.java @@ -0,0 +1,401 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.UpdateConditionModel; +import com.configcat.publicapi.java.client.model.UpdatePercentageOptionModel; +import com.configcat.publicapi.java.client.model.UpdateValueModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateTargetingRuleModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateTargetingRuleModel { + public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; + @SerializedName(SERIALIZED_NAME_CONDITIONS) + private List conditions; + + public static final String SERIALIZED_NAME_PERCENTAGE_OPTIONS = "percentageOptions"; + @SerializedName(SERIALIZED_NAME_PERCENTAGE_OPTIONS) + private List percentageOptions; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private UpdateValueModel value; + + public UpdateTargetingRuleModel() { + } + + public UpdateTargetingRuleModel conditions(List conditions) { + this.conditions = conditions; + return this; + } + + public UpdateTargetingRuleModel addConditionsItem(UpdateConditionModel conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * The list of conditions that are combined with logical AND operators. It can be one of the following: - User condition - Segment condition - Prerequisite flag condition + * @return conditions + */ + @javax.annotation.Nullable + public List getConditions() { + return conditions; + } + + public void setConditions(List conditions) { + this.conditions = conditions; + } + + + public UpdateTargetingRuleModel percentageOptions(List percentageOptions) { + this.percentageOptions = percentageOptions; + return this; + } + + public UpdateTargetingRuleModel addPercentageOptionsItem(UpdatePercentageOptionModel percentageOptionsItem) { + if (this.percentageOptions == null) { + this.percentageOptions = new ArrayList<>(); + } + this.percentageOptions.add(percentageOptionsItem); + return this; + } + + /** + * The percentage options from where the evaluation process will choose a value based on the flag's percentage evaluation attribute. + * @return percentageOptions + */ + @javax.annotation.Nullable + public List getPercentageOptions() { + return percentageOptions; + } + + public void setPercentageOptions(List percentageOptions) { + this.percentageOptions = percentageOptions; + } + + + public UpdateTargetingRuleModel value(UpdateValueModel value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nullable + public UpdateValueModel getValue() { + return value; + } + + public void setValue(UpdateValueModel value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateTargetingRuleModel instance itself + */ + public UpdateTargetingRuleModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateTargetingRuleModel updateTargetingRuleModel = (UpdateTargetingRuleModel) o; + return Objects.equals(this.conditions, updateTargetingRuleModel.conditions) && + Objects.equals(this.percentageOptions, updateTargetingRuleModel.percentageOptions) && + Objects.equals(this.value, updateTargetingRuleModel.value)&& + Objects.equals(this.additionalProperties, updateTargetingRuleModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(conditions, percentageOptions, value, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateTargetingRuleModel {\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" percentageOptions: ").append(toIndentedString(percentageOptions)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("conditions"); + openapiFields.add("percentageOptions"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateTargetingRuleModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateTargetingRuleModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateTargetingRuleModel is not found in the empty JSON string", UpdateTargetingRuleModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("conditions") != null && !jsonObj.get("conditions").isJsonNull()) { + JsonArray jsonArrayconditions = jsonObj.getAsJsonArray("conditions"); + if (jsonArrayconditions != null) { + // ensure the json data is an array + if (!jsonObj.get("conditions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `conditions` to be an array in the JSON string but got `%s`", jsonObj.get("conditions").toString())); + } + + // validate the optional field `conditions` (array) + for (int i = 0; i < jsonArrayconditions.size(); i++) { + UpdateConditionModel.validateJsonElement(jsonArrayconditions.get(i)); + }; + } + } + if (jsonObj.get("percentageOptions") != null && !jsonObj.get("percentageOptions").isJsonNull()) { + JsonArray jsonArraypercentageOptions = jsonObj.getAsJsonArray("percentageOptions"); + if (jsonArraypercentageOptions != null) { + // ensure the json data is an array + if (!jsonObj.get("percentageOptions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `percentageOptions` to be an array in the JSON string but got `%s`", jsonObj.get("percentageOptions").toString())); + } + + // validate the optional field `percentageOptions` (array) + for (int i = 0; i < jsonArraypercentageOptions.size(); i++) { + UpdatePercentageOptionModel.validateJsonElement(jsonArraypercentageOptions.get(i)); + }; + } + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + UpdateValueModel.validateJsonElement(jsonObj.get("value")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateTargetingRuleModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateTargetingRuleModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateTargetingRuleModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateTargetingRuleModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateTargetingRuleModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateTargetingRuleModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateTargetingRuleModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateTargetingRuleModel + * @throws IOException if the JSON string is invalid with respect to UpdateTargetingRuleModel + */ + public static UpdateTargetingRuleModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateTargetingRuleModel.class); + } + + /** + * Convert an instance of UpdateTargetingRuleModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateUserConditionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateUserConditionModel.java new file mode 100644 index 0000000..706438c --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateUserConditionModel.java @@ -0,0 +1,355 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.UpdateComparisonValueModel; +import com.configcat.publicapi.java.client.model.UserComparator; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Describes a condition that is based on user attributes. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateUserConditionModel { + public static final String SERIALIZED_NAME_COMPARISON_ATTRIBUTE = "comparisonAttribute"; + @SerializedName(SERIALIZED_NAME_COMPARISON_ATTRIBUTE) + private String comparisonAttribute; + + public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; + @SerializedName(SERIALIZED_NAME_COMPARATOR) + private UserComparator comparator; + + public static final String SERIALIZED_NAME_COMPARISON_VALUE = "comparisonValue"; + @SerializedName(SERIALIZED_NAME_COMPARISON_VALUE) + private UpdateComparisonValueModel comparisonValue; + + public UpdateUserConditionModel() { + } + + public UpdateUserConditionModel comparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; + return this; + } + + /** + * The User Object attribute that the condition is based on. Can be \"User ID\", \"Email\", \"Country\" or any custom attribute. + * @return comparisonAttribute + */ + @javax.annotation.Nonnull + public String getComparisonAttribute() { + return comparisonAttribute; + } + + public void setComparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; + } + + + public UpdateUserConditionModel comparator(UserComparator comparator) { + this.comparator = comparator; + return this; + } + + /** + * Get comparator + * @return comparator + */ + @javax.annotation.Nonnull + public UserComparator getComparator() { + return comparator; + } + + public void setComparator(UserComparator comparator) { + this.comparator = comparator; + } + + + public UpdateUserConditionModel comparisonValue(UpdateComparisonValueModel comparisonValue) { + this.comparisonValue = comparisonValue; + return this; + } + + /** + * Get comparisonValue + * @return comparisonValue + */ + @javax.annotation.Nonnull + public UpdateComparisonValueModel getComparisonValue() { + return comparisonValue; + } + + public void setComparisonValue(UpdateComparisonValueModel comparisonValue) { + this.comparisonValue = comparisonValue; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateUserConditionModel instance itself + */ + public UpdateUserConditionModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateUserConditionModel updateUserConditionModel = (UpdateUserConditionModel) o; + return Objects.equals(this.comparisonAttribute, updateUserConditionModel.comparisonAttribute) && + Objects.equals(this.comparator, updateUserConditionModel.comparator) && + Objects.equals(this.comparisonValue, updateUserConditionModel.comparisonValue)&& + Objects.equals(this.additionalProperties, updateUserConditionModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(comparisonAttribute, comparator, comparisonValue, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateUserConditionModel {\n"); + sb.append(" comparisonAttribute: ").append(toIndentedString(comparisonAttribute)).append("\n"); + sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); + sb.append(" comparisonValue: ").append(toIndentedString(comparisonValue)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("comparisonAttribute"); + openapiFields.add("comparator"); + openapiFields.add("comparisonValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("comparisonAttribute"); + openapiRequiredFields.add("comparator"); + openapiRequiredFields.add("comparisonValue"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateUserConditionModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateUserConditionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateUserConditionModel is not found in the empty JSON string", UpdateUserConditionModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateUserConditionModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("comparisonAttribute").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `comparisonAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonAttribute").toString())); + } + // validate the required field `comparator` + UserComparator.validateJsonElement(jsonObj.get("comparator")); + // validate the required field `comparisonValue` + UpdateComparisonValueModel.validateJsonElement(jsonObj.get("comparisonValue")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateUserConditionModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateUserConditionModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateUserConditionModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateUserConditionModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateUserConditionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateUserConditionModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateUserConditionModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateUserConditionModel + * @throws IOException if the JSON string is invalid with respect to UpdateUserConditionModel + */ + public static UpdateUserConditionModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateUserConditionModel.class); + } + + /** + * Convert an instance of UpdateUserConditionModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateValueModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateValueModel.java new file mode 100644 index 0000000..42110a7 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateValueModel.java @@ -0,0 +1,377 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Represents the value of a Feature Flag or Setting. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateValueModel { + public static final String SERIALIZED_NAME_BOOL_VALUE = "boolValue"; + @SerializedName(SERIALIZED_NAME_BOOL_VALUE) + private Boolean boolValue; + + public static final String SERIALIZED_NAME_STRING_VALUE = "stringValue"; + @SerializedName(SERIALIZED_NAME_STRING_VALUE) + private String stringValue; + + public static final String SERIALIZED_NAME_INT_VALUE = "intValue"; + @SerializedName(SERIALIZED_NAME_INT_VALUE) + private Integer intValue; + + public static final String SERIALIZED_NAME_DOUBLE_VALUE = "doubleValue"; + @SerializedName(SERIALIZED_NAME_DOUBLE_VALUE) + private Double doubleValue; + + public UpdateValueModel() { + } + + public UpdateValueModel boolValue(Boolean boolValue) { + this.boolValue = boolValue; + return this; + } + + /** + * The served value in case of a boolean Feature Flag. + * @return boolValue + */ + @javax.annotation.Nullable + public Boolean getBoolValue() { + return boolValue; + } + + public void setBoolValue(Boolean boolValue) { + this.boolValue = boolValue; + } + + + public UpdateValueModel stringValue(String stringValue) { + this.stringValue = stringValue; + return this; + } + + /** + * The served value in case of a text Setting. + * @return stringValue + */ + @javax.annotation.Nullable + public String getStringValue() { + return stringValue; + } + + public void setStringValue(String stringValue) { + this.stringValue = stringValue; + } + + + public UpdateValueModel intValue(Integer intValue) { + this.intValue = intValue; + return this; + } + + /** + * The served value in case of a whole number Setting. + * @return intValue + */ + @javax.annotation.Nullable + public Integer getIntValue() { + return intValue; + } + + public void setIntValue(Integer intValue) { + this.intValue = intValue; + } + + + public UpdateValueModel doubleValue(Double doubleValue) { + this.doubleValue = doubleValue; + return this; + } + + /** + * The served value in case of a decimal number Setting. + * @return doubleValue + */ + @javax.annotation.Nullable + public Double getDoubleValue() { + return doubleValue; + } + + public void setDoubleValue(Double doubleValue) { + this.doubleValue = doubleValue; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateValueModel instance itself + */ + public UpdateValueModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateValueModel updateValueModel = (UpdateValueModel) o; + return Objects.equals(this.boolValue, updateValueModel.boolValue) && + Objects.equals(this.stringValue, updateValueModel.stringValue) && + Objects.equals(this.intValue, updateValueModel.intValue) && + Objects.equals(this.doubleValue, updateValueModel.doubleValue)&& + Objects.equals(this.additionalProperties, updateValueModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(boolValue, stringValue, intValue, doubleValue, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateValueModel {\n"); + sb.append(" boolValue: ").append(toIndentedString(boolValue)).append("\n"); + sb.append(" stringValue: ").append(toIndentedString(stringValue)).append("\n"); + sb.append(" intValue: ").append(toIndentedString(intValue)).append("\n"); + sb.append(" doubleValue: ").append(toIndentedString(doubleValue)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("boolValue"); + openapiFields.add("stringValue"); + openapiFields.add("intValue"); + openapiFields.add("doubleValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateValueModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateValueModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateValueModel is not found in the empty JSON string", UpdateValueModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("stringValue") != null && !jsonObj.get("stringValue").isJsonNull()) && !jsonObj.get("stringValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stringValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stringValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateValueModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateValueModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateValueModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateValueModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateValueModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateValueModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateValueModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateValueModel + * @throws IOException if the JSON string is invalid with respect to UpdateValueModel + */ + public static UpdateValueModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateValueModel.class); + } + + /** + * Convert an instance of UpdateValueModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UserConditionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UserConditionModel.java index 0ec0140..6ac68d4 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 @@ -51,7 +51,7 @@ /** * Describes a condition that is based on user attributes. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class UserConditionModel { public static final String SERIALIZED_NAME_COMPARISON_ATTRIBUTE = "comparisonAttribute"; @SerializedName(SERIALIZED_NAME_COMPARISON_ATTRIBUTE) 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 3e7f32d..52f76f4 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 @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -50,7 +49,7 @@ /** * UserModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class UserModel { public static final String SERIALIZED_NAME_USER_ID = "userId"; @SerializedName(SERIALIZED_NAME_USER_ID) @@ -137,7 +136,7 @@ public UserModel twoFactorEnabled(Boolean twoFactorEnabled) { * Determines whether 2FA is enabled for the Member. * @return twoFactorEnabled */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Boolean getTwoFactorEnabled() { return twoFactorEnabled; } @@ -208,22 +207,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, userModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(userId, fullName, email, twoFactorEnabled, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -262,6 +250,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userId"); + openapiRequiredFields.add("fullName"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("twoFactorEnabled"); } /** @@ -276,6 +268,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in UserModel is not found in the empty JSON string", UserModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("userId") != null && !jsonObj.get("userId").isJsonNull()) && !jsonObj.get("userId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString())); 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 d56e917..3ed0264 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 @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -50,7 +49,7 @@ /** * Represents the value of a Feature Flag or Setting. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class ValueModel { public static final String SERIALIZED_NAME_BOOL_VALUE = "boolValue"; @SerializedName(SERIALIZED_NAME_BOOL_VALUE) @@ -208,22 +207,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, valueModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(boolValue, stringValue, intValue, doubleValue, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -262,6 +250,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("boolValue"); + openapiRequiredFields.add("stringValue"); + openapiRequiredFields.add("intValue"); + openapiRequiredFields.add("doubleValue"); } /** @@ -276,6 +268,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in ValueModel is not found in the empty JSON string", ValueModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ValueModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("stringValue") != null && !jsonObj.get("stringValue").isJsonNull()) && !jsonObj.get("stringValue").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `stringValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stringValue").toString())); diff --git a/src/main/java/com/configcat/publicapi/java/client/model/WebHookRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/WebHookRequestModel.java similarity index 86% rename from src/main/java/com/configcat/publicapi/java/client/model/WebHookRequest.java rename to src/main/java/com/configcat/publicapi/java/client/model/WebHookRequestModel.java index e5686e0..8e356d9 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/WebHookRequest.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/WebHookRequestModel.java @@ -52,10 +52,10 @@ import com.configcat.publicapi.java.client.JSON; /** - * WebHookRequest + * WebHookRequestModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class WebHookRequest { +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class WebHookRequestModel { public static final String SERIALIZED_NAME_URL = "url"; @SerializedName(SERIALIZED_NAME_URL) private String url; @@ -72,10 +72,10 @@ public class WebHookRequest { @SerializedName(SERIALIZED_NAME_WEB_HOOK_HEADERS) private List webHookHeaders; - public WebHookRequest() { + public WebHookRequestModel() { } - public WebHookRequest url(String url) { + public WebHookRequestModel url(String url) { this.url = url; return this; } @@ -94,7 +94,7 @@ public void setUrl(String url) { } - public WebHookRequest content(String content) { + public WebHookRequestModel content(String content) { this.content = content; return this; } @@ -113,7 +113,7 @@ public void setContent(String content) { } - public WebHookRequest httpMethod(WebHookHttpMethod httpMethod) { + public WebHookRequestModel httpMethod(WebHookHttpMethod httpMethod) { this.httpMethod = httpMethod; return this; } @@ -132,12 +132,12 @@ public void setHttpMethod(WebHookHttpMethod httpMethod) { } - public WebHookRequest webHookHeaders(List webHookHeaders) { + public WebHookRequestModel webHookHeaders(List webHookHeaders) { this.webHookHeaders = webHookHeaders; return this; } - public WebHookRequest addWebHookHeadersItem(WebhookHeaderModel webHookHeadersItem) { + public WebHookRequestModel addWebHookHeadersItem(WebhookHeaderModel webHookHeadersItem) { if (this.webHookHeaders == null) { this.webHookHeaders = new ArrayList<>(); } @@ -171,9 +171,9 @@ public void setWebHookHeaders(List webHookHeaders) { * * @param key name of the property * @param value value of the property - * @return the WebHookRequest instance itself + * @return the WebHookRequestModel instance itself */ - public WebHookRequest putAdditionalProperty(String key, Object value) { + public WebHookRequestModel putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -212,12 +212,12 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - WebHookRequest webHookRequest = (WebHookRequest) o; - return Objects.equals(this.url, webHookRequest.url) && - Objects.equals(this.content, webHookRequest.content) && - Objects.equals(this.httpMethod, webHookRequest.httpMethod) && - Objects.equals(this.webHookHeaders, webHookRequest.webHookHeaders)&& - Objects.equals(this.additionalProperties, webHookRequest.additionalProperties); + WebHookRequestModel webHookRequestModel = (WebHookRequestModel) o; + return Objects.equals(this.url, webHookRequestModel.url) && + Objects.equals(this.content, webHookRequestModel.content) && + Objects.equals(this.httpMethod, webHookRequestModel.httpMethod) && + Objects.equals(this.webHookHeaders, webHookRequestModel.webHookHeaders)&& + Objects.equals(this.additionalProperties, webHookRequestModel.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -239,7 +239,7 @@ private static int hashCodeNullable(JsonNullable a) { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class WebHookRequest {\n"); + sb.append("class WebHookRequestModel {\n"); sb.append(" url: ").append(toIndentedString(url)).append("\n"); sb.append(" content: ").append(toIndentedString(content)).append("\n"); sb.append(" httpMethod: ").append(toIndentedString(httpMethod)).append("\n"); @@ -281,17 +281,17 @@ private String toIndentedString(Object o) { * Validates the 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 + * @throws IOException if the JSON Element is invalid with respect to WebHookRequestModel */ 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())); + if (!WebHookRequestModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebHookRequestModel is not found in the empty JSON string", WebHookRequestModel.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebHookRequest.openapiRequiredFields) { + for (String requiredField : WebHookRequestModel.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } @@ -327,16 +327,16 @@ 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 + if (!WebHookRequestModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebHookRequestModel' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebHookRequest.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebHookRequestModel.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, WebHookRequest value) throws IOException { + public void write(JsonWriter out, WebHookRequestModel value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -364,12 +364,12 @@ else if (entry.getValue() instanceof Character) } @Override - public WebHookRequest read(JsonReader in) throws IOException { + public WebHookRequestModel read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - WebHookRequest instance = thisAdapter.fromJsonTree(jsonObj); + WebHookRequestModel instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -396,18 +396,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of WebHookRequest given an JSON string + * Create an instance of WebHookRequestModel 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 + * @return An instance of WebHookRequestModel + * @throws IOException if the JSON string is invalid with respect to WebHookRequestModel */ - public static WebHookRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebHookRequest.class); + public static WebHookRequestModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebHookRequestModel.class); } /** - * Convert an instance of WebHookRequest to an JSON string + * Convert an instance of WebHookRequestModel to an JSON string * * @return JSON string */ 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 ee3eb06..bde467d 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 @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -51,7 +50,7 @@ /** * The Config where the applied changes will invoke the Webhook. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class WebhookConfig { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -73,7 +72,7 @@ public WebhookConfig name(String name) { * The Config's name. * @return name */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getName() { return name; } @@ -92,7 +91,7 @@ public WebhookConfig configId(UUID configId) { * The Config's identifier. * @return configId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getConfigId() { return configId; } @@ -161,22 +160,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, webhookConfig.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(name, configId, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -211,6 +199,8 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("configId"); } /** @@ -225,11 +215,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookConfig is not found in the empty JSON string", WebhookConfig.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebhookConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } - if ((jsonObj.get("configId") != null && !jsonObj.get("configId").isJsonNull()) && !jsonObj.get("configId").isJsonPrimitive()) { + 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())); } } 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 5cc1abc..3db9671 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 @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -51,7 +50,7 @@ /** * The Environment where the applied changes will invoke the Webhook. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class WebhookEnvironment { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -73,7 +72,7 @@ public WebhookEnvironment name(String name) { * The Environment's name. * @return name */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getName() { return name; } @@ -92,7 +91,7 @@ public WebhookEnvironment environmentId(UUID environmentId) { * The Environment's identifier. * @return environmentId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public UUID getEnvironmentId() { return environmentId; } @@ -161,22 +160,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, webhookEnvironment.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(name, environmentId, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -211,6 +199,8 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("environmentId"); } /** @@ -225,11 +215,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookEnvironment is not found in the empty JSON string", WebhookEnvironment.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebhookEnvironment.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } - if ((jsonObj.get("environmentId") != null && !jsonObj.get("environmentId").isJsonNull()) && !jsonObj.get("environmentId").isJsonPrimitive()) { + if (!jsonObj.get("environmentId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); } } 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 37236cb..630a3b0 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 @@ -49,7 +49,7 @@ /** * WebhookHeaderModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class WebhookHeaderModel { public static final String SERIALIZED_NAME_KEY = "key"; @SerializedName(SERIALIZED_NAME_KEY) diff --git a/src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderResponseModel.java b/src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderResponseModel.java new file mode 100644 index 0000000..4b2d0eb --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderResponseModel.java @@ -0,0 +1,352 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * WebhookHeaderResponseModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class WebhookHeaderResponseModel { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_IS_SECURE = "isSecure"; + @SerializedName(SERIALIZED_NAME_IS_SECURE) + private Boolean isSecure; + + public WebhookHeaderResponseModel() { + } + + public WebhookHeaderResponseModel key(String key) { + this.key = key; + return this; + } + + /** + * The HTTP header key. + * @return key + */ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + + public WebhookHeaderResponseModel value(String value) { + this.value = value; + return this; + } + + /** + * The HTTP header value. + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + public WebhookHeaderResponseModel isSecure(Boolean isSecure) { + this.isSecure = isSecure; + return this; + } + + /** + * Indicates whether the header value is sensitive. + * @return isSecure + */ + @javax.annotation.Nonnull + public Boolean getIsSecure() { + return isSecure; + } + + public void setIsSecure(Boolean isSecure) { + this.isSecure = isSecure; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WebhookHeaderResponseModel instance itself + */ + public WebhookHeaderResponseModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebhookHeaderResponseModel webhookHeaderResponseModel = (WebhookHeaderResponseModel) o; + return Objects.equals(this.key, webhookHeaderResponseModel.key) && + Objects.equals(this.value, webhookHeaderResponseModel.value) && + Objects.equals(this.isSecure, webhookHeaderResponseModel.isSecure)&& + Objects.equals(this.additionalProperties, webhookHeaderResponseModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, isSecure, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebhookHeaderResponseModel {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" isSecure: ").append(toIndentedString(isSecure)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + openapiFields.add("isSecure"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + openapiRequiredFields.add("isSecure"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebhookHeaderResponseModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebhookHeaderResponseModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookHeaderResponseModel is not found in the empty JSON string", WebhookHeaderResponseModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebhookHeaderResponseModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebhookHeaderResponseModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookHeaderResponseModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookHeaderResponseModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebhookHeaderResponseModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WebhookHeaderResponseModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WebhookHeaderResponseModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebhookHeaderResponseModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebhookHeaderResponseModel + * @throws IOException if the JSON string is invalid with respect to WebhookHeaderResponseModel + */ + public static WebhookHeaderResponseModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookHeaderResponseModel.class); + } + + /** + * Convert an instance of WebhookHeaderResponseModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/WebhookModel.java b/src/main/java/com/configcat/publicapi/java/client/model/WebhookResponseModel.java similarity index 74% rename from src/main/java/com/configcat/publicapi/java/client/model/WebhookModel.java rename to src/main/java/com/configcat/publicapi/java/client/model/WebhookResponseModel.java index 148c655..7da1d97 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/WebhookModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/WebhookResponseModel.java @@ -17,7 +17,7 @@ import com.configcat.publicapi.java.client.model.WebHookHttpMethod; import com.configcat.publicapi.java.client.model.WebhookConfig; import com.configcat.publicapi.java.client.model.WebhookEnvironment; -import com.configcat.publicapi.java.client.model.WebhookHeaderModel; +import com.configcat.publicapi.java.client.model.WebhookHeaderResponseModel; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -27,7 +27,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -54,10 +53,10 @@ import com.configcat.publicapi.java.client.JSON; /** - * WebhookModel + * WebhookResponseModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class WebhookModel { +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class WebhookResponseModel { public static final String SERIALIZED_NAME_WEBHOOK_ID = "webhookId"; @SerializedName(SERIALIZED_NAME_WEBHOOK_ID) private Integer webhookId; @@ -76,7 +75,7 @@ public class WebhookModel { public static final String SERIALIZED_NAME_WEB_HOOK_HEADERS = "webHookHeaders"; @SerializedName(SERIALIZED_NAME_WEB_HOOK_HEADERS) - private List webHookHeaders; + private List webHookHeaders = new ArrayList<>(); public static final String SERIALIZED_NAME_CONFIG = "config"; @SerializedName(SERIALIZED_NAME_CONFIG) @@ -86,10 +85,10 @@ public class WebhookModel { @SerializedName(SERIALIZED_NAME_ENVIRONMENT) private WebhookEnvironment environment; - public WebhookModel() { + public WebhookResponseModel() { } - public WebhookModel webhookId(Integer webhookId) { + public WebhookResponseModel webhookId(Integer webhookId) { this.webhookId = webhookId; return this; } @@ -98,7 +97,7 @@ public WebhookModel webhookId(Integer webhookId) { * The identifier of the Webhook. * @return webhookId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Integer getWebhookId() { return webhookId; } @@ -108,7 +107,7 @@ public void setWebhookId(Integer webhookId) { } - public WebhookModel url(String url) { + public WebhookResponseModel url(String url) { this.url = url; return this; } @@ -117,7 +116,7 @@ public WebhookModel url(String url) { * The URL of the Webhook. * @return url */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getUrl() { return url; } @@ -127,7 +126,7 @@ public void setUrl(String url) { } - public WebhookModel httpMethod(WebHookHttpMethod httpMethod) { + public WebhookResponseModel httpMethod(WebHookHttpMethod httpMethod) { this.httpMethod = httpMethod; return this; } @@ -136,7 +135,7 @@ public WebhookModel httpMethod(WebHookHttpMethod httpMethod) { * Get httpMethod * @return httpMethod */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public WebHookHttpMethod getHttpMethod() { return httpMethod; } @@ -146,7 +145,7 @@ public void setHttpMethod(WebHookHttpMethod httpMethod) { } - public WebhookModel content(String content) { + public WebhookResponseModel content(String content) { this.content = content; return this; } @@ -165,12 +164,12 @@ public void setContent(String content) { } - public WebhookModel webHookHeaders(List webHookHeaders) { + public WebhookResponseModel webHookHeaders(List webHookHeaders) { this.webHookHeaders = webHookHeaders; return this; } - public WebhookModel addWebHookHeadersItem(WebhookHeaderModel webHookHeadersItem) { + public WebhookResponseModel addWebHookHeadersItem(WebhookHeaderResponseModel webHookHeadersItem) { if (this.webHookHeaders == null) { this.webHookHeaders = new ArrayList<>(); } @@ -182,17 +181,17 @@ public WebhookModel addWebHookHeadersItem(WebhookHeaderModel webHookHeadersItem) * List of HTTP headers that the Webhook must send. * @return webHookHeaders */ - @javax.annotation.Nullable - public List getWebHookHeaders() { + @javax.annotation.Nonnull + public List getWebHookHeaders() { return webHookHeaders; } - public void setWebHookHeaders(List webHookHeaders) { + public void setWebHookHeaders(List webHookHeaders) { this.webHookHeaders = webHookHeaders; } - public WebhookModel config(WebhookConfig config) { + public WebhookResponseModel config(WebhookConfig config) { this.config = config; return this; } @@ -201,7 +200,7 @@ public WebhookModel config(WebhookConfig config) { * Get config * @return config */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public WebhookConfig getConfig() { return config; } @@ -211,7 +210,7 @@ public void setConfig(WebhookConfig config) { } - public WebhookModel environment(WebhookEnvironment environment) { + public WebhookResponseModel environment(WebhookEnvironment environment) { this.environment = environment; return this; } @@ -220,7 +219,7 @@ public WebhookModel environment(WebhookEnvironment environment) { * Get environment * @return environment */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public WebhookEnvironment getEnvironment() { return environment; } @@ -242,9 +241,9 @@ public void setEnvironment(WebhookEnvironment environment) { * * @param key name of the property * @param value value of the property - * @return the WebhookModel instance itself + * @return the WebhookResponseModel instance itself */ - public WebhookModel putAdditionalProperty(String key, Object value) { + public WebhookResponseModel putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -283,19 +282,15 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - WebhookModel webhookModel = (WebhookModel) o; - return Objects.equals(this.webhookId, webhookModel.webhookId) && - Objects.equals(this.url, webhookModel.url) && - Objects.equals(this.httpMethod, webhookModel.httpMethod) && - Objects.equals(this.content, webhookModel.content) && - Objects.equals(this.webHookHeaders, webhookModel.webHookHeaders) && - Objects.equals(this.config, webhookModel.config) && - Objects.equals(this.environment, webhookModel.environment)&& - Objects.equals(this.additionalProperties, webhookModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + WebhookResponseModel webhookResponseModel = (WebhookResponseModel) o; + return Objects.equals(this.webhookId, webhookResponseModel.webhookId) && + Objects.equals(this.url, webhookResponseModel.url) && + Objects.equals(this.httpMethod, webhookResponseModel.httpMethod) && + Objects.equals(this.content, webhookResponseModel.content) && + Objects.equals(this.webHookHeaders, webhookResponseModel.webHookHeaders) && + Objects.equals(this.config, webhookResponseModel.config) && + Objects.equals(this.environment, webhookResponseModel.environment)&& + Objects.equals(this.additionalProperties, webhookResponseModel.additionalProperties); } @Override @@ -303,17 +298,10 @@ public int hashCode() { return Objects.hash(webhookId, url, httpMethod, content, webHookHeaders, config, environment, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class WebhookModel {\n"); + sb.append("class WebhookResponseModel {\n"); sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n"); sb.append(" url: ").append(toIndentedString(url)).append("\n"); sb.append(" httpMethod: ").append(toIndentedString(httpMethod)).append("\n"); @@ -354,69 +342,73 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("webhookId"); + openapiRequiredFields.add("url"); + openapiRequiredFields.add("httpMethod"); + openapiRequiredFields.add("content"); + openapiRequiredFields.add("webHookHeaders"); + openapiRequiredFields.add("config"); + openapiRequiredFields.add("environment"); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebhookModel + * @throws IOException if the JSON Element is invalid with respect to WebhookResponseModel */ 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 (!WebhookResponseModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookResponseModel is not found in the empty JSON string", WebhookResponseModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebhookResponseModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("url") != null && !jsonObj.get("url").isJsonNull()) && !jsonObj.get("url").isJsonPrimitive()) { + if (!jsonObj.get("url").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } - // validate the optional field `httpMethod` - if (jsonObj.get("httpMethod") != null && !jsonObj.get("httpMethod").isJsonNull()) { - WebHookHttpMethod.validateJsonElement(jsonObj.get("httpMethod")); - } + // validate the required field `httpMethod` + WebHookHttpMethod.validateJsonElement(jsonObj.get("httpMethod")); if ((jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) && !jsonObj.get("content").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `content` to be a primitive type in the JSON string but got `%s`", jsonObj.get("content").toString())); } - 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")); + // ensure the json data is an array + if (!jsonObj.get("webHookHeaders").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `webHookHeaders` to be an array in the JSON string but got `%s`", jsonObj.get("webHookHeaders").toString())); } + + JsonArray jsonArraywebHookHeaders = jsonObj.getAsJsonArray("webHookHeaders"); + // validate the required field `webHookHeaders` (array) + for (int i = 0; i < jsonArraywebHookHeaders.size(); i++) { + WebhookHeaderResponseModel.validateJsonElement(jsonArraywebHookHeaders.get(i)); + }; + // validate the required field `config` + WebhookConfig.validateJsonElement(jsonObj.get("config")); + // validate the required field `environment` + WebhookEnvironment.validateJsonElement(jsonObj.get("environment")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebhookModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebhookModel' and its subtypes + if (!WebhookResponseModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookResponseModel' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebhookModel.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookResponseModel.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, WebhookModel value) throws IOException { + public void write(JsonWriter out, WebhookResponseModel value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -444,12 +436,12 @@ else if (entry.getValue() instanceof Character) } @Override - public WebhookModel read(JsonReader in) throws IOException { + public WebhookResponseModel read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - WebhookModel instance = thisAdapter.fromJsonTree(jsonObj); + WebhookResponseModel instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -476,18 +468,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of WebhookModel given an JSON string + * Create an instance of WebhookResponseModel 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 + * @return An instance of WebhookResponseModel + * @throws IOException if the JSON string is invalid with respect to WebhookResponseModel */ - public static WebhookModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebhookModel.class); + public static WebhookResponseModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookResponseModel.class); } /** - * Convert an instance of WebhookModel to an JSON string + * Convert an instance of WebhookResponseModel to an JSON string * * @return JSON string */ 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 191d09c..411fbc1 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 @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -50,7 +49,7 @@ /** * WebhookSigningKeysModel */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") public class WebhookSigningKeysModel { public static final String SERIALIZED_NAME_KEY1 = "key1"; @SerializedName(SERIALIZED_NAME_KEY1) @@ -160,22 +159,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, webhookSigningKeysModel.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(key1, key2, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -210,6 +198,8 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key1"); + openapiRequiredFields.add("key2"); } /** @@ -224,6 +214,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookSigningKeysModel is not found in the empty JSON string", WebhookSigningKeysModel.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebhookSigningKeysModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("key1") != null && !jsonObj.get("key1").isJsonNull()) && !jsonObj.get("key1").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `key1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key1").toString()));