diff --git a/openapi/schemas/asset.openapi.json b/openapi/schemas/asset.openapi.json index 9fa9c323..b0a5dff8 100644 --- a/openapi/schemas/asset.openapi.json +++ b/openapi/schemas/asset.openapi.json @@ -200,6 +200,9 @@ { "$ref": "#/components/schemas/IMetadataCountMetadata" }, + { + "$ref": "#/components/schemas/IMetadataDurationMetadata" + }, { "$ref": "#/components/schemas/IMetadataFileTypeMetadata" }, @@ -220,9 +223,6 @@ }, { "$ref": "#/components/schemas/IMetadataTextMetadata" - }, - { - "$ref": "#/components/schemas/IMetadataVideoDurationMetadata" } ], "discriminator": { @@ -230,14 +230,14 @@ "mapping": { "ClassificationMetadata": "#/components/schemas/IMetadataClassificationMetadata", "CountMetadata": "#/components/schemas/IMetadataCountMetadata", + "DurationMetadata": "#/components/schemas/IMetadataDurationMetadata", "FileTypeMetadata": "#/components/schemas/IMetadataFileTypeMetadata", "ImageDimensionMetadata": "#/components/schemas/IMetadataImageDimensionMetadata", "LocationMetadata": "#/components/schemas/IMetadataLocationMetadata", "OriginalFilenameMetadata": "#/components/schemas/IMetadataOriginalFilenameMetadata", "SourceUrlMetadata": "#/components/schemas/IMetadataSourceUrlMetadata", "StreamsMetadata": "#/components/schemas/IMetadataStreamsMetadata", - "TextMetadata": "#/components/schemas/IMetadataTextMetadata", - "VideoDurationMetadata": "#/components/schemas/IMetadataVideoDurationMetadata" + "TextMetadata": "#/components/schemas/IMetadataTextMetadata" } } }, @@ -282,6 +282,27 @@ } } }, + "IMetadataDurationMetadata": { + "required": [ + "duration", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "DurationMetadata" + ], + "type": "string" + }, + "duration": { + "type": "string", + "format": "date-time" + }, + "visibilities": { + "$ref": "#/components/schemas/MetadataVisibilities" + } + } + }, "IMetadataFileTypeMetadata": { "required": [ "fileType", @@ -438,27 +459,6 @@ } } }, - "IMetadataVideoDurationMetadata": { - "required": [ - "duration", - "_t" - ], - "properties": { - "_t": { - "enum": [ - "VideoDurationMetadata" - ], - "type": "string" - }, - "duration": { - "type": "string", - "format": "date-time" - }, - "visibilities": { - "$ref": "#/components/schemas/MetadataVisibilities" - } - } - }, "MetadataCollection": { "type": "object", "additionalProperties": { diff --git a/openapi/schemas/audience.openapi.json b/openapi/schemas/audience.openapi.json index 26f82bef..e0b668f2 100644 --- a/openapi/schemas/audience.openapi.json +++ b/openapi/schemas/audience.openapi.json @@ -409,7 +409,8 @@ "AddRapidToAudienceModel": { "required": [ "asset", - "payload" + "payload", + "randomCorrectProbability" ], "type": "object", "properties": { @@ -1745,6 +1746,14 @@ }, "boundingBoxes": { "$ref": "#/components/schemas/ListOfBoxShape" + }, + "requiredPrecision": { + "type": "number", + "format": "double" + }, + "requiredCompleteness": { + "type": "number", + "format": "double" } } }, @@ -2176,6 +2185,7 @@ "definitionId", "audienceId", "revisionNumber", + "pipelineId", "status", "createdAt" ], @@ -2197,6 +2207,9 @@ "type": "integer", "format": "int32" }, + "pipelineId": { + "type": "string" + }, "status": { "type": "string" }, diff --git a/openapi/schemas/campaign.openapi.json b/openapi/schemas/campaign.openapi.json index fa8e4e04..4f6f0d5f 100644 --- a/openapi/schemas/campaign.openapi.json +++ b/openapi/schemas/campaign.openapi.json @@ -284,6 +284,12 @@ "items": { "type": "string" } + }, + "kayzenAudienceIds": { + "type": "array", + "items": { + "type": "number" + } } } }, diff --git a/openapi/schemas/leaderboard.openapi.json b/openapi/schemas/leaderboard.openapi.json index 5dc68251..20f676a7 100644 --- a/openapi/schemas/leaderboard.openapi.json +++ b/openapi/schemas/leaderboard.openapi.json @@ -2969,9 +2969,6 @@ }, { "$ref": "#/components/schemas/ICampaignFilterUserScoreFilter" - }, - { - "$ref": "#/components/schemas/ICampaignFilterUserStateFilter" } ], "discriminator": { @@ -2987,8 +2984,7 @@ "OrFilter": "#/components/schemas/ICampaignFilterOrFilter", "ResponseCountFilter": "#/components/schemas/ICampaignFilterResponseCountFilter", "UserActionRestrictionFilter": "#/components/schemas/ICampaignFilterUserActionRestrictionFilter", - "UserScoreFilter": "#/components/schemas/ICampaignFilterUserScoreFilter", - "UserStateFilter": "#/components/schemas/ICampaignFilterUserStateFilter" + "UserScoreFilter": "#/components/schemas/ICampaignFilterUserScoreFilter" } } }, @@ -3269,34 +3265,6 @@ } } }, - "ICampaignFilterUserStateFilter": { - "required": [ - "states", - "_t" - ], - "properties": { - "_t": { - "enum": [ - "UserStateFilter" - ], - "type": "string" - }, - "states": { - "type": "array", - "items": { - "enum": [ - "Training", - "Blacklist", - "Active" - ] - } - }, - "executionOrder": { - "type": "integer", - "format": "uint32" - } - } - }, "IMetadataInput": { "required": [ "_t" diff --git a/openapi/schemas/order.openapi.json b/openapi/schemas/order.openapi.json index 83638a4a..36ab3b0e 100644 --- a/openapi/schemas/order.openapi.json +++ b/openapi/schemas/order.openapi.json @@ -289,6 +289,52 @@ } } }, + "/job/{jobId}": { + "get": { + "tags": [ + "Job" + ], + "summary": "Gets a job by its id.", + "parameters": [ + { + "name": "jobId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetJobByIdEndpoint_Output" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthenticated" + }, + "403": { + "description": "Forbidden" + } + } + } + }, "/job/definition/{definitionId}/revision/{revisionNumber}": { "get": { "tags": [ @@ -1923,6 +1969,65 @@ "In" ] }, + "GetJobByIdEndpoint_Output": { + "required": [ + "jobId", + "name", + "definitionId", + "audienceId", + "revisionNumber", + "pipelineId", + "status", + "createdAt" + ], + "type": "object", + "properties": { + "jobId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "definitionId": { + "type": "string" + }, + "audienceId": { + "type": "string" + }, + "revisionNumber": { + "type": "integer", + "format": "int32" + }, + "pipelineId": { + "type": "string" + }, + "status": { + "type": "string" + }, + "completedAt": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "resultFileName": { + "type": "string", + "nullable": true + }, + "failedAt": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "failureMessage": { + "type": "string", + "nullable": true + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } + }, "GetJobDefinitionByIdEndpoint_Output": { "required": [ "definitionId", @@ -4111,6 +4216,7 @@ "definitionId", "audienceId", "revisionNumber", + "pipelineId", "status", "createdAt" ], @@ -4132,6 +4238,9 @@ "type": "integer", "format": "int32" }, + "pipelineId": { + "type": "string" + }, "status": { "type": "string" }, diff --git a/openapi/schemas/pipeline.openapi.json b/openapi/schemas/pipeline.openapi.json index 12ab8858..3b2345dc 100644 --- a/openapi/schemas/pipeline.openapi.json +++ b/openapi/schemas/pipeline.openapi.json @@ -494,6 +494,9 @@ { "$ref": "#/components/schemas/IMetadataCountMetadata" }, + { + "$ref": "#/components/schemas/IMetadataDurationMetadata" + }, { "$ref": "#/components/schemas/IMetadataFileTypeMetadata" }, @@ -514,9 +517,6 @@ }, { "$ref": "#/components/schemas/IMetadataTextMetadata" - }, - { - "$ref": "#/components/schemas/IMetadataVideoDurationMetadata" } ], "discriminator": { @@ -524,14 +524,14 @@ "mapping": { "ClassificationMetadata": "#/components/schemas/IMetadataClassificationMetadata", "CountMetadata": "#/components/schemas/IMetadataCountMetadata", + "DurationMetadata": "#/components/schemas/IMetadataDurationMetadata", "FileTypeMetadata": "#/components/schemas/IMetadataFileTypeMetadata", "ImageDimensionMetadata": "#/components/schemas/IMetadataImageDimensionMetadata", "LocationMetadata": "#/components/schemas/IMetadataLocationMetadata", "OriginalFilenameMetadata": "#/components/schemas/IMetadataOriginalFilenameMetadata", "SourceUrlMetadata": "#/components/schemas/IMetadataSourceUrlMetadata", "StreamsMetadata": "#/components/schemas/IMetadataStreamsMetadata", - "TextMetadata": "#/components/schemas/IMetadataTextMetadata", - "VideoDurationMetadata": "#/components/schemas/IMetadataVideoDurationMetadata" + "TextMetadata": "#/components/schemas/IMetadataTextMetadata" } } }, @@ -576,6 +576,27 @@ } } }, + "IMetadataDurationMetadata": { + "required": [ + "duration", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "DurationMetadata" + ], + "type": "string" + }, + "duration": { + "type": "string", + "format": "date-time" + }, + "visibilities": { + "$ref": "#/components/schemas/MetadataVisibilities" + } + } + }, "IMetadataFileTypeMetadata": { "required": [ "fileType", @@ -732,27 +753,6 @@ } } }, - "IMetadataVideoDurationMetadata": { - "required": [ - "duration", - "_t" - ], - "properties": { - "_t": { - "enum": [ - "VideoDurationMetadata" - ], - "type": "string" - }, - "duration": { - "type": "string", - "format": "date-time" - }, - "visibilities": { - "$ref": "#/components/schemas/MetadataVisibilities" - } - } - }, "IPairMakerConfig": { "required": [ "_t" diff --git a/openapi/schemas/rapid.openapi.json b/openapi/schemas/rapid.openapi.json index 9c36403b..08b87ebf 100644 --- a/openapi/schemas/rapid.openapi.json +++ b/openapi/schemas/rapid.openapi.json @@ -2205,6 +2205,326 @@ }, "boundingBoxes": { "$ref": "#/components/schemas/ListOfBoxShape" + }, + "requiredPrecision": { + "type": "number", + "format": "double" + }, + "requiredCompleteness": { + "type": "number", + "format": "double" + } + } + }, + "IValidationTruthModel": { + "required": [ + "_t" + ], + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/IValidationTruthModelAttachCategoryTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelBoundingBoxTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelClassifyTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelCompareTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelEmptyValidationTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelLineTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelLocateBoxTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelMultiCompareTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelNamedEntityTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelPolygonTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelScrubTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelSkipTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelTranscriptionTruthModel" + } + ], + "discriminator": { + "propertyName": "_t", + "mapping": { + "AttachCategoryTruth": "#/components/schemas/IValidationTruthModelAttachCategoryTruthModel", + "BoundingBoxTruth": "#/components/schemas/IValidationTruthModelBoundingBoxTruthModel", + "ClassifyTruth": "#/components/schemas/IValidationTruthModelClassifyTruthModel", + "CompareTruth": "#/components/schemas/IValidationTruthModelCompareTruthModel", + "EmptyValidationTruth": "#/components/schemas/IValidationTruthModelEmptyValidationTruthModel", + "LineTruth": "#/components/schemas/IValidationTruthModelLineTruthModel", + "LocateBoxTruth": "#/components/schemas/IValidationTruthModelLocateBoxTruthModel", + "MultiCompareTruth": "#/components/schemas/IValidationTruthModelMultiCompareTruthModel", + "NamedEntityTruth": "#/components/schemas/IValidationTruthModelNamedEntityTruthModel", + "PolygonTruth": "#/components/schemas/IValidationTruthModelPolygonTruthModel", + "ScrubTruth": "#/components/schemas/IValidationTruthModelScrubTruthModel", + "SkipTruth": "#/components/schemas/IValidationTruthModelSkipTruthModel", + "TranscriptionTruth": "#/components/schemas/IValidationTruthModelTranscriptionTruthModel" + } + } + }, + "IValidationTruthModelAttachCategoryTruthModel": { + "required": [ + "correctCategories", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "AttachCategoryTruth" + ], + "type": "string" + }, + "correctCategories": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "IValidationTruthModelBoundingBoxTruthModel": { + "required": [ + "xMin", + "yMin", + "xMax", + "yMax", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "BoundingBoxTruth" + ], + "type": "string" + }, + "xMin": { + "type": "number", + "format": "double" + }, + "yMin": { + "type": "number", + "format": "double" + }, + "xMax": { + "type": "number", + "format": "double" + }, + "yMax": { + "type": "number", + "format": "double" + } + } + }, + "IValidationTruthModelClassifyTruthModel": { + "required": [ + "correctCategories", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "ClassifyTruth" + ], + "type": "string" + }, + "correctCategories": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "IValidationTruthModelCompareTruthModel": { + "required": [ + "winnerId", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "CompareTruth" + ], + "type": "string" + }, + "winnerId": { + "type": "string" + } + } + }, + "IValidationTruthModelEmptyValidationTruthModel": { + "required": [ + "_t" + ], + "properties": { + "_t": { + "enum": [ + "EmptyValidationTruth" + ], + "type": "string" + } + } + }, + "IValidationTruthModelLineTruthModel": { + "required": [ + "_t" + ], + "properties": { + "_t": { + "enum": [ + "LineTruth" + ], + "type": "string" + } + } + }, + "IValidationTruthModelLocateBoxTruthModel": { + "required": [ + "boundingBoxes", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "LocateBoxTruth" + ], + "type": "string" + }, + "boundingBoxes": { + "$ref": "#/components/schemas/ListOfBoxShape" + }, + "requiredPrecision": { + "type": "number", + "format": "double" + }, + "requiredCompleteness": { + "type": "number", + "format": "double" + } + } + }, + "IValidationTruthModelMultiCompareTruthModel": { + "required": [ + "correctCombinations", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "MultiCompareTruth" + ], + "type": "string" + }, + "correctCombinations": { + "$ref": "#/components/schemas/ListOfListOfString" + } + } + }, + "IValidationTruthModelNamedEntityTruthModel": { + "required": [ + "classifications", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "NamedEntityTruth" + ], + "type": "string" + }, + "classifications": { + "$ref": "#/components/schemas/ListOfNamedClassification" + } + } + }, + "IValidationTruthModelPolygonTruthModel": { + "required": [ + "_t" + ], + "properties": { + "_t": { + "enum": [ + "PolygonTruth" + ], + "type": "string" + } + } + }, + "IValidationTruthModelScrubTruthModel": { + "required": [ + "validRanges", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "ScrubTruth" + ], + "type": "string" + }, + "validRanges": { + "$ref": "#/components/schemas/ListOfScrubRange" + } + } + }, + "IValidationTruthModelSkipTruthModel": { + "required": [ + "_t" + ], + "properties": { + "_t": { + "enum": [ + "SkipTruth" + ], + "type": "string" + } + } + }, + "IValidationTruthModelTranscriptionTruthModel": { + "required": [ + "correctWords", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "TranscriptionTruth" + ], + "type": "string" + }, + "correctWords": { + "$ref": "#/components/schemas/ListOfTranscriptionWord" + }, + "strictGrading": { + "type": "boolean", + "nullable": true + }, + "requiredPrecision": { + "type": "number", + "format": "double" + }, + "requiredCompleteness": { + "type": "number", + "format": "double" } } }, @@ -2556,10 +2876,10 @@ } ] }, - "OptionOfIValidationTruth": { + "OptionOfIValidationTruthModel": { "oneOf": [ { - "$ref": "#/components/schemas/IValidationTruth" + "$ref": "#/components/schemas/IValidationTruthModel" }, { "nullable": true @@ -3002,7 +3322,7 @@ "type": "object", "properties": { "truth": { - "$ref": "#/components/schemas/OptionOfIValidationTruth" + "$ref": "#/components/schemas/OptionOfIValidationTruthModel" }, "explanation": { "$ref": "#/components/schemas/OptionOfstring" diff --git a/openapi/schemas/rapidata.filtered.openapi.json b/openapi/schemas/rapidata.filtered.openapi.json index 13bdceba..800a1286 100644 --- a/openapi/schemas/rapidata.filtered.openapi.json +++ b/openapi/schemas/rapidata.filtered.openapi.json @@ -4759,6 +4759,67 @@ ] } }, + "/job/{jobId}": { + "get": { + "tags": [ + "Job" + ], + "summary": "Gets a job by its id.", + "parameters": [ + { + "name": "jobId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetJobByIdEndpoint_Output" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthenticated" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "Bearer": [], + "OpenIdConnect": [ + "openid", + "profile", + "email" + ], + "OAuth2": [ + "openid", + "profile", + "email" + ] + } + ] + } + }, "/job/definition/{definitionId}/revision/{revisionNumber}": { "get": { "tags": [ @@ -8465,6 +8526,9 @@ { "$ref": "#/components/schemas/IMetadataCountMetadata" }, + { + "$ref": "#/components/schemas/IMetadataDurationMetadata" + }, { "$ref": "#/components/schemas/IMetadataFileTypeMetadata" }, @@ -8485,9 +8549,6 @@ }, { "$ref": "#/components/schemas/IMetadataTextMetadata" - }, - { - "$ref": "#/components/schemas/IMetadataVideoDurationMetadata" } ], "discriminator": { @@ -8495,14 +8556,14 @@ "mapping": { "ClassificationMetadata": "#/components/schemas/IMetadataClassificationMetadata", "CountMetadata": "#/components/schemas/IMetadataCountMetadata", + "DurationMetadata": "#/components/schemas/IMetadataDurationMetadata", "FileTypeMetadata": "#/components/schemas/IMetadataFileTypeMetadata", "ImageDimensionMetadata": "#/components/schemas/IMetadataImageDimensionMetadata", "LocationMetadata": "#/components/schemas/IMetadataLocationMetadata", "OriginalFilenameMetadata": "#/components/schemas/IMetadataOriginalFilenameMetadata", "SourceUrlMetadata": "#/components/schemas/IMetadataSourceUrlMetadata", "StreamsMetadata": "#/components/schemas/IMetadataStreamsMetadata", - "TextMetadata": "#/components/schemas/IMetadataTextMetadata", - "VideoDurationMetadata": "#/components/schemas/IMetadataVideoDurationMetadata" + "TextMetadata": "#/components/schemas/IMetadataTextMetadata" } } }, @@ -8547,6 +8608,27 @@ } } }, + "IMetadataDurationMetadata": { + "required": [ + "duration", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "DurationMetadata" + ], + "type": "string" + }, + "duration": { + "type": "string", + "format": "date-time" + }, + "visibilities": { + "$ref": "#/components/schemas/MetadataVisibilities" + } + } + }, "IMetadataFileTypeMetadata": { "required": [ "fileType", @@ -8703,27 +8785,6 @@ } } }, - "IMetadataVideoDurationMetadata": { - "required": [ - "duration", - "_t" - ], - "properties": { - "_t": { - "enum": [ - "VideoDurationMetadata" - ], - "type": "string" - }, - "duration": { - "type": "string", - "format": "date-time" - }, - "visibilities": { - "$ref": "#/components/schemas/MetadataVisibilities" - } - } - }, "MetadataCollection": { "type": "object", "additionalProperties": { @@ -8783,7 +8844,8 @@ "AddRapidToAudienceModel": { "required": [ "asset", - "payload" + "payload", + "randomCorrectProbability" ], "type": "object", "properties": { @@ -10111,6 +10173,14 @@ }, "boundingBoxes": { "$ref": "#/components/schemas/ListOfBoxShape" + }, + "requiredPrecision": { + "type": "number", + "format": "double" + }, + "requiredCompleteness": { + "type": "number", + "format": "double" } } }, @@ -10528,6 +10598,7 @@ "definitionId", "audienceId", "revisionNumber", + "pipelineId", "status", "createdAt" ], @@ -10549,6 +10620,9 @@ "type": "integer", "format": "int32" }, + "pipelineId": { + "type": "string" + }, "status": { "type": "string" }, @@ -10803,6 +10877,12 @@ "items": { "type": "string" } + }, + "kayzenAudienceIds": { + "type": "array", + "items": { + "type": "number" + } } } }, @@ -12336,9 +12416,6 @@ }, { "$ref": "#/components/schemas/ICampaignFilterUserScoreFilter" - }, - { - "$ref": "#/components/schemas/ICampaignFilterUserStateFilter" } ], "discriminator": { @@ -12354,8 +12431,7 @@ "OrFilter": "#/components/schemas/ICampaignFilterOrFilter", "ResponseCountFilter": "#/components/schemas/ICampaignFilterResponseCountFilter", "UserActionRestrictionFilter": "#/components/schemas/ICampaignFilterUserActionRestrictionFilter", - "UserScoreFilter": "#/components/schemas/ICampaignFilterUserScoreFilter", - "UserStateFilter": "#/components/schemas/ICampaignFilterUserStateFilter" + "UserScoreFilter": "#/components/schemas/ICampaignFilterUserScoreFilter" } } }, @@ -12636,34 +12712,6 @@ } } }, - "ICampaignFilterUserStateFilter": { - "required": [ - "states", - "_t" - ], - "properties": { - "_t": { - "enum": [ - "UserStateFilter" - ], - "type": "string" - }, - "states": { - "type": "array", - "items": { - "enum": [ - "Training", - "Blacklist", - "Active" - ] - } - }, - "executionOrder": { - "type": "integer", - "format": "uint32" - } - } - }, "IUserFilterModel": { "required": [ "_t" @@ -14350,6 +14398,65 @@ "type": "string", "format": "binary" }, + "GetJobByIdEndpoint_Output": { + "required": [ + "jobId", + "name", + "definitionId", + "audienceId", + "revisionNumber", + "pipelineId", + "status", + "createdAt" + ], + "type": "object", + "properties": { + "jobId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "definitionId": { + "type": "string" + }, + "audienceId": { + "type": "string" + }, + "revisionNumber": { + "type": "integer", + "format": "int32" + }, + "pipelineId": { + "type": "string" + }, + "status": { + "type": "string" + }, + "completedAt": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "resultFileName": { + "type": "string", + "nullable": true + }, + "failedAt": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "failureMessage": { + "type": "string", + "nullable": true + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } + }, "GetJobDefinitionByIdEndpoint_Output": { "required": [ "definitionId", @@ -17211,6 +17318,318 @@ } } }, + "IValidationTruthModel": { + "required": [ + "_t" + ], + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/IValidationTruthModelAttachCategoryTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelBoundingBoxTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelClassifyTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelCompareTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelEmptyValidationTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelLineTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelLocateBoxTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelMultiCompareTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelNamedEntityTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelPolygonTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelScrubTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelSkipTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelTranscriptionTruthModel" + } + ], + "discriminator": { + "propertyName": "_t", + "mapping": { + "AttachCategoryTruth": "#/components/schemas/IValidationTruthModelAttachCategoryTruthModel", + "BoundingBoxTruth": "#/components/schemas/IValidationTruthModelBoundingBoxTruthModel", + "ClassifyTruth": "#/components/schemas/IValidationTruthModelClassifyTruthModel", + "CompareTruth": "#/components/schemas/IValidationTruthModelCompareTruthModel", + "EmptyValidationTruth": "#/components/schemas/IValidationTruthModelEmptyValidationTruthModel", + "LineTruth": "#/components/schemas/IValidationTruthModelLineTruthModel", + "LocateBoxTruth": "#/components/schemas/IValidationTruthModelLocateBoxTruthModel", + "MultiCompareTruth": "#/components/schemas/IValidationTruthModelMultiCompareTruthModel", + "NamedEntityTruth": "#/components/schemas/IValidationTruthModelNamedEntityTruthModel", + "PolygonTruth": "#/components/schemas/IValidationTruthModelPolygonTruthModel", + "ScrubTruth": "#/components/schemas/IValidationTruthModelScrubTruthModel", + "SkipTruth": "#/components/schemas/IValidationTruthModelSkipTruthModel", + "TranscriptionTruth": "#/components/schemas/IValidationTruthModelTranscriptionTruthModel" + } + } + }, + "IValidationTruthModelAttachCategoryTruthModel": { + "required": [ + "correctCategories", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "AttachCategoryTruth" + ], + "type": "string" + }, + "correctCategories": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "IValidationTruthModelBoundingBoxTruthModel": { + "required": [ + "xMin", + "yMin", + "xMax", + "yMax", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "BoundingBoxTruth" + ], + "type": "string" + }, + "xMin": { + "type": "number", + "format": "double" + }, + "yMin": { + "type": "number", + "format": "double" + }, + "xMax": { + "type": "number", + "format": "double" + }, + "yMax": { + "type": "number", + "format": "double" + } + } + }, + "IValidationTruthModelClassifyTruthModel": { + "required": [ + "correctCategories", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "ClassifyTruth" + ], + "type": "string" + }, + "correctCategories": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "IValidationTruthModelCompareTruthModel": { + "required": [ + "winnerId", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "CompareTruth" + ], + "type": "string" + }, + "winnerId": { + "type": "string" + } + } + }, + "IValidationTruthModelEmptyValidationTruthModel": { + "required": [ + "_t" + ], + "properties": { + "_t": { + "enum": [ + "EmptyValidationTruth" + ], + "type": "string" + } + } + }, + "IValidationTruthModelLineTruthModel": { + "required": [ + "_t" + ], + "properties": { + "_t": { + "enum": [ + "LineTruth" + ], + "type": "string" + } + } + }, + "IValidationTruthModelLocateBoxTruthModel": { + "required": [ + "boundingBoxes", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "LocateBoxTruth" + ], + "type": "string" + }, + "boundingBoxes": { + "$ref": "#/components/schemas/ListOfBoxShape" + }, + "requiredPrecision": { + "type": "number", + "format": "double" + }, + "requiredCompleteness": { + "type": "number", + "format": "double" + } + } + }, + "IValidationTruthModelMultiCompareTruthModel": { + "required": [ + "correctCombinations", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "MultiCompareTruth" + ], + "type": "string" + }, + "correctCombinations": { + "$ref": "#/components/schemas/ListOfListOfString" + } + } + }, + "IValidationTruthModelNamedEntityTruthModel": { + "required": [ + "classifications", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "NamedEntityTruth" + ], + "type": "string" + }, + "classifications": { + "$ref": "#/components/schemas/ListOfNamedClassification" + } + } + }, + "IValidationTruthModelPolygonTruthModel": { + "required": [ + "_t" + ], + "properties": { + "_t": { + "enum": [ + "PolygonTruth" + ], + "type": "string" + } + } + }, + "IValidationTruthModelScrubTruthModel": { + "required": [ + "validRanges", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "ScrubTruth" + ], + "type": "string" + }, + "validRanges": { + "$ref": "#/components/schemas/ListOfScrubRange" + } + } + }, + "IValidationTruthModelSkipTruthModel": { + "required": [ + "_t" + ], + "properties": { + "_t": { + "enum": [ + "SkipTruth" + ], + "type": "string" + } + } + }, + "IValidationTruthModelTranscriptionTruthModel": { + "required": [ + "correctWords", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "TranscriptionTruth" + ], + "type": "string" + }, + "correctWords": { + "$ref": "#/components/schemas/ListOfTranscriptionWord" + }, + "strictGrading": { + "type": "boolean", + "nullable": true + }, + "requiredPrecision": { + "type": "number", + "format": "double" + }, + "requiredCompleteness": { + "type": "number", + "format": "double" + } + } + }, "LineResult_Line": { "required": [ "size", @@ -17330,10 +17749,10 @@ } ] }, - "OptionOfIValidationTruth": { + "OptionOfIValidationTruthModel": { "oneOf": [ { - "$ref": "#/components/schemas/IValidationTruth" + "$ref": "#/components/schemas/IValidationTruthModel" }, { "nullable": true @@ -17649,7 +18068,7 @@ "type": "object", "properties": { "truth": { - "$ref": "#/components/schemas/OptionOfIValidationTruth" + "$ref": "#/components/schemas/OptionOfIValidationTruthModel" }, "explanation": { "$ref": "#/components/schemas/OptionOfstring" @@ -17684,7 +18103,7 @@ "nullable": true }, { - "$ref": "#/components/schemas/IValidationTruth" + "$ref": "#/components/schemas/IValidationTruthModel" } ] }, @@ -17765,7 +18184,7 @@ "nullable": true }, { - "$ref": "#/components/schemas/IValidationTruth" + "$ref": "#/components/schemas/IValidationTruthModel" } ] }, @@ -17880,7 +18299,7 @@ "nullable": true }, { - "$ref": "#/components/schemas/IValidationTruth" + "$ref": "#/components/schemas/IValidationTruthModel" } ] }, diff --git a/openapi/schemas/rapidata.openapi.json b/openapi/schemas/rapidata.openapi.json index eee713e5..b8badf3c 100644 --- a/openapi/schemas/rapidata.openapi.json +++ b/openapi/schemas/rapidata.openapi.json @@ -5624,6 +5624,67 @@ ] } }, + "/job/{jobId}": { + "get": { + "tags": [ + "Job" + ], + "summary": "Gets a job by its id.", + "parameters": [ + { + "name": "jobId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetJobByIdEndpoint_Output" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthenticated" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "Bearer": [], + "OpenIdConnect": [ + "openid", + "profile", + "email" + ], + "OAuth2": [ + "openid", + "profile", + "email" + ] + } + ] + } + }, "/job/definition/{definitionId}/revision/{revisionNumber}": { "get": { "tags": [ @@ -9550,6 +9611,9 @@ { "$ref": "#/components/schemas/IMetadataCountMetadata" }, + { + "$ref": "#/components/schemas/IMetadataDurationMetadata" + }, { "$ref": "#/components/schemas/IMetadataFileTypeMetadata" }, @@ -9570,9 +9634,6 @@ }, { "$ref": "#/components/schemas/IMetadataTextMetadata" - }, - { - "$ref": "#/components/schemas/IMetadataVideoDurationMetadata" } ], "discriminator": { @@ -9580,14 +9641,14 @@ "mapping": { "ClassificationMetadata": "#/components/schemas/IMetadataClassificationMetadata", "CountMetadata": "#/components/schemas/IMetadataCountMetadata", + "DurationMetadata": "#/components/schemas/IMetadataDurationMetadata", "FileTypeMetadata": "#/components/schemas/IMetadataFileTypeMetadata", "ImageDimensionMetadata": "#/components/schemas/IMetadataImageDimensionMetadata", "LocationMetadata": "#/components/schemas/IMetadataLocationMetadata", "OriginalFilenameMetadata": "#/components/schemas/IMetadataOriginalFilenameMetadata", "SourceUrlMetadata": "#/components/schemas/IMetadataSourceUrlMetadata", "StreamsMetadata": "#/components/schemas/IMetadataStreamsMetadata", - "TextMetadata": "#/components/schemas/IMetadataTextMetadata", - "VideoDurationMetadata": "#/components/schemas/IMetadataVideoDurationMetadata" + "TextMetadata": "#/components/schemas/IMetadataTextMetadata" } } }, @@ -9632,6 +9693,27 @@ } } }, + "IMetadataDurationMetadata": { + "required": [ + "duration", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "DurationMetadata" + ], + "type": "string" + }, + "duration": { + "type": "string", + "format": "date-time" + }, + "visibilities": { + "$ref": "#/components/schemas/MetadataVisibilities" + } + } + }, "IMetadataFileTypeMetadata": { "required": [ "fileType", @@ -9788,27 +9870,6 @@ } } }, - "IMetadataVideoDurationMetadata": { - "required": [ - "duration", - "_t" - ], - "properties": { - "_t": { - "enum": [ - "VideoDurationMetadata" - ], - "type": "string" - }, - "duration": { - "type": "string", - "format": "date-time" - }, - "visibilities": { - "$ref": "#/components/schemas/MetadataVisibilities" - } - } - }, "MetadataCollection": { "type": "object", "additionalProperties": { @@ -9868,7 +9929,8 @@ "AddRapidToAudienceModel": { "required": [ "asset", - "payload" + "payload", + "randomCorrectProbability" ], "type": "object", "properties": { @@ -11196,6 +11258,14 @@ }, "boundingBoxes": { "$ref": "#/components/schemas/ListOfBoxShape" + }, + "requiredPrecision": { + "type": "number", + "format": "double" + }, + "requiredCompleteness": { + "type": "number", + "format": "double" } } }, @@ -11613,6 +11683,7 @@ "definitionId", "audienceId", "revisionNumber", + "pipelineId", "status", "createdAt" ], @@ -11634,6 +11705,9 @@ "type": "integer", "format": "int32" }, + "pipelineId": { + "type": "string" + }, "status": { "type": "string" }, @@ -11888,6 +11962,12 @@ "items": { "type": "string" } + }, + "kayzenAudienceIds": { + "type": "array", + "items": { + "type": "number" + } } } }, @@ -13421,9 +13501,6 @@ }, { "$ref": "#/components/schemas/ICampaignFilterUserScoreFilter" - }, - { - "$ref": "#/components/schemas/ICampaignFilterUserStateFilter" } ], "discriminator": { @@ -13439,8 +13516,7 @@ "OrFilter": "#/components/schemas/ICampaignFilterOrFilter", "ResponseCountFilter": "#/components/schemas/ICampaignFilterResponseCountFilter", "UserActionRestrictionFilter": "#/components/schemas/ICampaignFilterUserActionRestrictionFilter", - "UserScoreFilter": "#/components/schemas/ICampaignFilterUserScoreFilter", - "UserStateFilter": "#/components/schemas/ICampaignFilterUserStateFilter" + "UserScoreFilter": "#/components/schemas/ICampaignFilterUserScoreFilter" } } }, @@ -13721,34 +13797,6 @@ } } }, - "ICampaignFilterUserStateFilter": { - "required": [ - "states", - "_t" - ], - "properties": { - "_t": { - "enum": [ - "UserStateFilter" - ], - "type": "string" - }, - "states": { - "type": "array", - "items": { - "enum": [ - "Training", - "Blacklist", - "Active" - ] - } - }, - "executionOrder": { - "type": "integer", - "format": "uint32" - } - } - }, "IUserFilterModel": { "required": [ "_t" @@ -15435,6 +15483,65 @@ "type": "string", "format": "binary" }, + "GetJobByIdEndpoint_Output": { + "required": [ + "jobId", + "name", + "definitionId", + "audienceId", + "revisionNumber", + "pipelineId", + "status", + "createdAt" + ], + "type": "object", + "properties": { + "jobId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "definitionId": { + "type": "string" + }, + "audienceId": { + "type": "string" + }, + "revisionNumber": { + "type": "integer", + "format": "int32" + }, + "pipelineId": { + "type": "string" + }, + "status": { + "type": "string" + }, + "completedAt": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "resultFileName": { + "type": "string", + "nullable": true + }, + "failedAt": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "failureMessage": { + "type": "string", + "nullable": true + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } + }, "GetJobDefinitionByIdEndpoint_Output": { "required": [ "definitionId", @@ -18296,6 +18403,318 @@ } } }, + "IValidationTruthModel": { + "required": [ + "_t" + ], + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/IValidationTruthModelAttachCategoryTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelBoundingBoxTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelClassifyTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelCompareTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelEmptyValidationTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelLineTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelLocateBoxTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelMultiCompareTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelNamedEntityTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelPolygonTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelScrubTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelSkipTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelTranscriptionTruthModel" + } + ], + "discriminator": { + "propertyName": "_t", + "mapping": { + "AttachCategoryTruth": "#/components/schemas/IValidationTruthModelAttachCategoryTruthModel", + "BoundingBoxTruth": "#/components/schemas/IValidationTruthModelBoundingBoxTruthModel", + "ClassifyTruth": "#/components/schemas/IValidationTruthModelClassifyTruthModel", + "CompareTruth": "#/components/schemas/IValidationTruthModelCompareTruthModel", + "EmptyValidationTruth": "#/components/schemas/IValidationTruthModelEmptyValidationTruthModel", + "LineTruth": "#/components/schemas/IValidationTruthModelLineTruthModel", + "LocateBoxTruth": "#/components/schemas/IValidationTruthModelLocateBoxTruthModel", + "MultiCompareTruth": "#/components/schemas/IValidationTruthModelMultiCompareTruthModel", + "NamedEntityTruth": "#/components/schemas/IValidationTruthModelNamedEntityTruthModel", + "PolygonTruth": "#/components/schemas/IValidationTruthModelPolygonTruthModel", + "ScrubTruth": "#/components/schemas/IValidationTruthModelScrubTruthModel", + "SkipTruth": "#/components/schemas/IValidationTruthModelSkipTruthModel", + "TranscriptionTruth": "#/components/schemas/IValidationTruthModelTranscriptionTruthModel" + } + } + }, + "IValidationTruthModelAttachCategoryTruthModel": { + "required": [ + "correctCategories", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "AttachCategoryTruth" + ], + "type": "string" + }, + "correctCategories": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "IValidationTruthModelBoundingBoxTruthModel": { + "required": [ + "xMin", + "yMin", + "xMax", + "yMax", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "BoundingBoxTruth" + ], + "type": "string" + }, + "xMin": { + "type": "number", + "format": "double" + }, + "yMin": { + "type": "number", + "format": "double" + }, + "xMax": { + "type": "number", + "format": "double" + }, + "yMax": { + "type": "number", + "format": "double" + } + } + }, + "IValidationTruthModelClassifyTruthModel": { + "required": [ + "correctCategories", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "ClassifyTruth" + ], + "type": "string" + }, + "correctCategories": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "IValidationTruthModelCompareTruthModel": { + "required": [ + "winnerId", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "CompareTruth" + ], + "type": "string" + }, + "winnerId": { + "type": "string" + } + } + }, + "IValidationTruthModelEmptyValidationTruthModel": { + "required": [ + "_t" + ], + "properties": { + "_t": { + "enum": [ + "EmptyValidationTruth" + ], + "type": "string" + } + } + }, + "IValidationTruthModelLineTruthModel": { + "required": [ + "_t" + ], + "properties": { + "_t": { + "enum": [ + "LineTruth" + ], + "type": "string" + } + } + }, + "IValidationTruthModelLocateBoxTruthModel": { + "required": [ + "boundingBoxes", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "LocateBoxTruth" + ], + "type": "string" + }, + "boundingBoxes": { + "$ref": "#/components/schemas/ListOfBoxShape" + }, + "requiredPrecision": { + "type": "number", + "format": "double" + }, + "requiredCompleteness": { + "type": "number", + "format": "double" + } + } + }, + "IValidationTruthModelMultiCompareTruthModel": { + "required": [ + "correctCombinations", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "MultiCompareTruth" + ], + "type": "string" + }, + "correctCombinations": { + "$ref": "#/components/schemas/ListOfListOfString" + } + } + }, + "IValidationTruthModelNamedEntityTruthModel": { + "required": [ + "classifications", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "NamedEntityTruth" + ], + "type": "string" + }, + "classifications": { + "$ref": "#/components/schemas/ListOfNamedClassification" + } + } + }, + "IValidationTruthModelPolygonTruthModel": { + "required": [ + "_t" + ], + "properties": { + "_t": { + "enum": [ + "PolygonTruth" + ], + "type": "string" + } + } + }, + "IValidationTruthModelScrubTruthModel": { + "required": [ + "validRanges", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "ScrubTruth" + ], + "type": "string" + }, + "validRanges": { + "$ref": "#/components/schemas/ListOfScrubRange" + } + } + }, + "IValidationTruthModelSkipTruthModel": { + "required": [ + "_t" + ], + "properties": { + "_t": { + "enum": [ + "SkipTruth" + ], + "type": "string" + } + } + }, + "IValidationTruthModelTranscriptionTruthModel": { + "required": [ + "correctWords", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "TranscriptionTruth" + ], + "type": "string" + }, + "correctWords": { + "$ref": "#/components/schemas/ListOfTranscriptionWord" + }, + "strictGrading": { + "type": "boolean", + "nullable": true + }, + "requiredPrecision": { + "type": "number", + "format": "double" + }, + "requiredCompleteness": { + "type": "number", + "format": "double" + } + } + }, "LineResult_Line": { "required": [ "size", @@ -18415,10 +18834,10 @@ } ] }, - "OptionOfIValidationTruth": { + "OptionOfIValidationTruthModel": { "oneOf": [ { - "$ref": "#/components/schemas/IValidationTruth" + "$ref": "#/components/schemas/IValidationTruthModel" }, { "nullable": true @@ -18734,7 +19153,7 @@ "type": "object", "properties": { "truth": { - "$ref": "#/components/schemas/OptionOfIValidationTruth" + "$ref": "#/components/schemas/OptionOfIValidationTruthModel" }, "explanation": { "$ref": "#/components/schemas/OptionOfstring" @@ -18769,7 +19188,7 @@ "nullable": true }, { - "$ref": "#/components/schemas/IValidationTruth" + "$ref": "#/components/schemas/IValidationTruthModel" } ] }, @@ -18850,7 +19269,7 @@ "nullable": true }, { - "$ref": "#/components/schemas/IValidationTruth" + "$ref": "#/components/schemas/IValidationTruthModel" } ] }, @@ -18965,7 +19384,7 @@ "nullable": true }, { - "$ref": "#/components/schemas/IValidationTruth" + "$ref": "#/components/schemas/IValidationTruthModel" } ] }, diff --git a/openapi/schemas/validation.openapi.json b/openapi/schemas/validation.openapi.json index 353b707a..c85a9b75 100644 --- a/openapi/schemas/validation.openapi.json +++ b/openapi/schemas/validation.openapi.json @@ -679,7 +679,7 @@ "nullable": true }, { - "$ref": "#/components/schemas/IValidationTruth" + "$ref": "#/components/schemas/IValidationTruthModel" } ] }, @@ -760,7 +760,7 @@ "nullable": true }, { - "$ref": "#/components/schemas/IValidationTruth" + "$ref": "#/components/schemas/IValidationTruthModel" } ] }, @@ -971,7 +971,7 @@ "nullable": true }, { - "$ref": "#/components/schemas/IValidationTruth" + "$ref": "#/components/schemas/IValidationTruthModel" } ] }, @@ -1879,68 +1879,72 @@ } } }, - "IValidationTruth": { + "IValidationTruthModel": { "required": [ "_t" ], "type": "object", "oneOf": [ { - "$ref": "#/components/schemas/IValidationTruthTranscriptionTruth" + "$ref": "#/components/schemas/IValidationTruthModelAttachCategoryTruthModel" }, { - "$ref": "#/components/schemas/IValidationTruthScrubTruth" + "$ref": "#/components/schemas/IValidationTruthModelBoundingBoxTruthModel" }, { - "$ref": "#/components/schemas/IValidationTruthPolygonTruth" + "$ref": "#/components/schemas/IValidationTruthModelClassifyTruthModel" }, { - "$ref": "#/components/schemas/IValidationTruthNamedEntityTruth" + "$ref": "#/components/schemas/IValidationTruthModelCompareTruthModel" }, { - "$ref": "#/components/schemas/IValidationTruthLocateBoxTruth" + "$ref": "#/components/schemas/IValidationTruthModelEmptyValidationTruthModel" }, { - "$ref": "#/components/schemas/IValidationTruthLineTruth" + "$ref": "#/components/schemas/IValidationTruthModelLineTruthModel" }, { - "$ref": "#/components/schemas/IValidationTruthEmptyValidationTruth" + "$ref": "#/components/schemas/IValidationTruthModelLocateBoxTruthModel" }, { - "$ref": "#/components/schemas/IValidationTruthCompareTruth" + "$ref": "#/components/schemas/IValidationTruthModelMultiCompareTruthModel" }, { - "$ref": "#/components/schemas/IValidationTruthMultiCompareTruth" + "$ref": "#/components/schemas/IValidationTruthModelNamedEntityTruthModel" }, { - "$ref": "#/components/schemas/IValidationTruthSkipTruth" + "$ref": "#/components/schemas/IValidationTruthModelPolygonTruthModel" }, { - "$ref": "#/components/schemas/IValidationTruthAttachCategoryTruth" + "$ref": "#/components/schemas/IValidationTruthModelScrubTruthModel" }, { - "$ref": "#/components/schemas/IValidationTruthBoundingBoxTruth" + "$ref": "#/components/schemas/IValidationTruthModelSkipTruthModel" + }, + { + "$ref": "#/components/schemas/IValidationTruthModelTranscriptionTruthModel" } ], "discriminator": { "propertyName": "_t", "mapping": { - "TranscriptionTruth": "#/components/schemas/IValidationTruthTranscriptionTruth", - "ScrubTruth": "#/components/schemas/IValidationTruthScrubTruth", - "PolygonTruth": "#/components/schemas/IValidationTruthPolygonTruth", - "NamedEntityTruth": "#/components/schemas/IValidationTruthNamedEntityTruth", - "LocateBoxTruth": "#/components/schemas/IValidationTruthLocateBoxTruth", - "LineTruth": "#/components/schemas/IValidationTruthLineTruth", - "EmptyValidationTruth": "#/components/schemas/IValidationTruthEmptyValidationTruth", - "CompareTruth": "#/components/schemas/IValidationTruthCompareTruth", - "MultiCompareTruth": "#/components/schemas/IValidationTruthMultiCompareTruth", - "SkipTruth": "#/components/schemas/IValidationTruthSkipTruth", - "AttachCategoryTruth": "#/components/schemas/IValidationTruthAttachCategoryTruth", - "BoundingBoxTruth": "#/components/schemas/IValidationTruthBoundingBoxTruth" + "AttachCategoryTruth": "#/components/schemas/IValidationTruthModelAttachCategoryTruthModel", + "BoundingBoxTruth": "#/components/schemas/IValidationTruthModelBoundingBoxTruthModel", + "ClassifyTruth": "#/components/schemas/IValidationTruthModelClassifyTruthModel", + "CompareTruth": "#/components/schemas/IValidationTruthModelCompareTruthModel", + "EmptyValidationTruth": "#/components/schemas/IValidationTruthModelEmptyValidationTruthModel", + "LineTruth": "#/components/schemas/IValidationTruthModelLineTruthModel", + "LocateBoxTruth": "#/components/schemas/IValidationTruthModelLocateBoxTruthModel", + "MultiCompareTruth": "#/components/schemas/IValidationTruthModelMultiCompareTruthModel", + "NamedEntityTruth": "#/components/schemas/IValidationTruthModelNamedEntityTruthModel", + "PolygonTruth": "#/components/schemas/IValidationTruthModelPolygonTruthModel", + "ScrubTruth": "#/components/schemas/IValidationTruthModelScrubTruthModel", + "SkipTruth": "#/components/schemas/IValidationTruthModelSkipTruthModel", + "TranscriptionTruth": "#/components/schemas/IValidationTruthModelTranscriptionTruthModel" } } }, - "IValidationTruthAttachCategoryTruth": { + "IValidationTruthModelAttachCategoryTruthModel": { "required": [ "correctCategories", "_t" @@ -1960,7 +1964,7 @@ } } }, - "IValidationTruthBoundingBoxTruth": { + "IValidationTruthModelBoundingBoxTruthModel": { "required": [ "xMin", "yMin", @@ -1993,7 +1997,27 @@ } } }, - "IValidationTruthCompareTruth": { + "IValidationTruthModelClassifyTruthModel": { + "required": [ + "correctCategories", + "_t" + ], + "properties": { + "_t": { + "enum": [ + "ClassifyTruth" + ], + "type": "string" + }, + "correctCategories": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "IValidationTruthModelCompareTruthModel": { "required": [ "winnerId", "_t" @@ -2010,7 +2034,7 @@ } } }, - "IValidationTruthEmptyValidationTruth": { + "IValidationTruthModelEmptyValidationTruthModel": { "required": [ "_t" ], @@ -2023,7 +2047,7 @@ } } }, - "IValidationTruthLineTruth": { + "IValidationTruthModelLineTruthModel": { "required": [ "_t" ], @@ -2036,7 +2060,7 @@ } } }, - "IValidationTruthLocateBoxTruth": { + "IValidationTruthModelLocateBoxTruthModel": { "required": [ "boundingBoxes", "_t" @@ -2050,10 +2074,18 @@ }, "boundingBoxes": { "$ref": "#/components/schemas/ListOfBoxShape" + }, + "requiredPrecision": { + "type": "number", + "format": "double" + }, + "requiredCompleteness": { + "type": "number", + "format": "double" } } }, - "IValidationTruthMultiCompareTruth": { + "IValidationTruthModelMultiCompareTruthModel": { "required": [ "correctCombinations", "_t" @@ -2070,7 +2102,7 @@ } } }, - "IValidationTruthNamedEntityTruth": { + "IValidationTruthModelNamedEntityTruthModel": { "required": [ "classifications", "_t" @@ -2087,7 +2119,7 @@ } } }, - "IValidationTruthPolygonTruth": { + "IValidationTruthModelPolygonTruthModel": { "required": [ "_t" ], @@ -2100,7 +2132,7 @@ } } }, - "IValidationTruthScrubTruth": { + "IValidationTruthModelScrubTruthModel": { "required": [ "validRanges", "_t" @@ -2117,7 +2149,7 @@ } } }, - "IValidationTruthSkipTruth": { + "IValidationTruthModelSkipTruthModel": { "required": [ "_t" ], @@ -2130,7 +2162,7 @@ } } }, - "IValidationTruthTranscriptionTruth": { + "IValidationTruthModelTranscriptionTruthModel": { "required": [ "correctWords", "_t" diff --git a/src/rapidata/api_client/api/job_api.py b/src/rapidata/api_client/api/job_api.py index 0d8e7ae6..0e6ba2ad 100644 --- a/src/rapidata/api_client/api/job_api.py +++ b/src/rapidata/api_client/api/job_api.py @@ -25,6 +25,7 @@ from rapidata.api_client.models.create_job_endpoint_output import CreateJobEndpointOutput from rapidata.api_client.models.create_job_revision_endpoint_input import CreateJobRevisionEndpointInput from rapidata.api_client.models.create_job_revision_endpoint_output import CreateJobRevisionEndpointOutput +from rapidata.api_client.models.get_job_by_id_endpoint_output import GetJobByIdEndpointOutput from rapidata.api_client.models.get_job_definition_by_id_endpoint_output import GetJobDefinitionByIdEndpointOutput from rapidata.api_client.models.get_job_revision_endpoint_output import GetJobRevisionEndpointOutput from rapidata.api_client.models.paged_result_of_query_job_definitions_result import PagedResultOfQueryJobDefinitionsResult @@ -2292,6 +2293,275 @@ def _job_definitions_get_serialize( + @validate_call + def job_job_id_get( + self, + job_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetJobByIdEndpointOutput: + """Gets a job by its id. + + + :param job_id: (required) + :type job_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._job_job_id_get_serialize( + job_id=job_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetJobByIdEndpointOutput", + '400': "ValidationProblemDetails", + '401': None, + '403': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def job_job_id_get_with_http_info( + self, + job_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetJobByIdEndpointOutput]: + """Gets a job by its id. + + + :param job_id: (required) + :type job_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._job_job_id_get_serialize( + job_id=job_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetJobByIdEndpointOutput", + '400': "ValidationProblemDetails", + '401': None, + '403': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def job_job_id_get_without_preload_content( + self, + job_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets a job by its id. + + + :param job_id: (required) + :type job_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._job_job_id_get_serialize( + job_id=job_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetJobByIdEndpointOutput", + '400': "ValidationProblemDetails", + '401': None, + '403': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _job_job_id_get_serialize( + self, + job_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job_id is not None: + _path_params['jobId'] = job_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2', + 'OpenIdConnect', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/job/{jobId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def job_post( self, diff --git a/src/rapidata/api_client/models/add_rapid_to_audience_model.py b/src/rapidata/api_client/models/add_rapid_to_audience_model.py index 5ed9966b..26f2b352 100644 --- a/src/rapidata/api_client/models/add_rapid_to_audience_model.py +++ b/src/rapidata/api_client/models/add_rapid_to_audience_model.py @@ -33,7 +33,7 @@ class AddRapidToAudienceModel(BaseModel): asset: IAssetInput payload: IRapidPayload truth: Optional[IValidationTruth] = None - random_correct_probability: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="randomCorrectProbability") + random_correct_probability: Union[StrictFloat, StrictInt] = Field(alias="randomCorrectProbability") explanation: Optional[StrictStr] = None context: Optional[StrictStr] = None context_asset: Optional[IAssetInput] = Field(default=None, alias="contextAsset") diff --git a/src/rapidata/api_client/models/add_validation_rapid_model.py b/src/rapidata/api_client/models/add_validation_rapid_model.py index e3f0383c..afde2b11 100644 --- a/src/rapidata/api_client/models/add_validation_rapid_model.py +++ b/src/rapidata/api_client/models/add_validation_rapid_model.py @@ -23,7 +23,7 @@ from rapidata.api_client.models.i_asset_input import IAssetInput from rapidata.api_client.models.i_rapid_payload import IRapidPayload from rapidata.api_client.models.i_validation_metadata_input import IValidationMetadataInput -from rapidata.api_client.models.i_validation_truth import IValidationTruth +from rapidata.api_client.models.i_validation_truth_model import IValidationTruthModel from typing import Optional, Set from typing_extensions import Self @@ -33,7 +33,7 @@ class AddValidationRapidModel(BaseModel): """ # noqa: E501 asset: IAssetInput payload: IRapidPayload - truth: Optional[IValidationTruth] = None + truth: Optional[IValidationTruthModel] = None random_correct_probability: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="randomCorrectProbability") explanation: Optional[StrictStr] = None context: Optional[StrictStr] = None @@ -141,7 +141,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "asset": IAssetInput.from_dict(obj["asset"]) if obj.get("asset") is not None else None, "payload": IRapidPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None, - "truth": IValidationTruth.from_dict(obj["truth"]) if obj.get("truth") is not None else None, + "truth": IValidationTruthModel.from_dict(obj["truth"]) if obj.get("truth") is not None else None, "randomCorrectProbability": obj.get("randomCorrectProbability"), "explanation": obj.get("explanation"), "context": obj.get("context"), diff --git a/src/rapidata/api_client/models/add_validation_rapid_new_model.py b/src/rapidata/api_client/models/add_validation_rapid_new_model.py index cfd185a8..29c1981e 100644 --- a/src/rapidata/api_client/models/add_validation_rapid_new_model.py +++ b/src/rapidata/api_client/models/add_validation_rapid_new_model.py @@ -23,7 +23,7 @@ from rapidata.api_client.models.i_asset_input import IAssetInput from rapidata.api_client.models.i_rapid_payload import IRapidPayload from rapidata.api_client.models.i_validation_metadata_input import IValidationMetadataInput -from rapidata.api_client.models.i_validation_truth import IValidationTruth +from rapidata.api_client.models.i_validation_truth_model import IValidationTruthModel from typing import Optional, Set from typing_extensions import Self @@ -34,7 +34,7 @@ class AddValidationRapidNewModel(BaseModel): asset: IAssetInput payload: IRapidPayload metadata: List[IValidationMetadataInput] - truth: Optional[IValidationTruth] + truth: Optional[IValidationTruthModel] random_correct_probability: Union[StrictFloat, StrictInt] = Field(alias="randomCorrectProbability") explanation: Optional[StrictStr] feature_flags: Optional[List[FeatureFlagModel]] = Field(default=None, alias="featureFlags") @@ -127,7 +127,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "asset": IAssetInput.from_dict(obj["asset"]) if obj.get("asset") is not None else None, "payload": IRapidPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None, "metadata": [IValidationMetadataInput.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None, - "truth": IValidationTruth.from_dict(obj["truth"]) if obj.get("truth") is not None else None, + "truth": IValidationTruthModel.from_dict(obj["truth"]) if obj.get("truth") is not None else None, "randomCorrectProbability": obj.get("randomCorrectProbability"), "explanation": obj.get("explanation"), "featureFlags": [FeatureFlagModel.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None diff --git a/src/rapidata/api_client/models/boosting_profile.py b/src/rapidata/api_client/models/boosting_profile.py index 561406d0..3441e6f7 100644 --- a/src/rapidata/api_client/models/boosting_profile.py +++ b/src/rapidata/api_client/models/boosting_profile.py @@ -17,8 +17,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Optional, Set from typing_extensions import Self @@ -28,7 +28,8 @@ class BoostingProfile(BaseModel): """ # noqa: E501 requires_global_boost: Optional[StrictBool] = Field(default=None, alias="requiresGlobalBoost") language_boosts: Optional[List[StrictStr]] = Field(default=None, alias="languageBoosts") - __properties: ClassVar[List[str]] = ["requiresGlobalBoost", "languageBoosts"] + kayzen_audience_ids: Optional[List[Union[StrictFloat, StrictInt]]] = Field(default=None, alias="kayzenAudienceIds") + __properties: ClassVar[List[str]] = ["requiresGlobalBoost", "languageBoosts", "kayzenAudienceIds"] model_config = ConfigDict( populate_by_name=True, @@ -82,7 +83,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "requiresGlobalBoost": obj.get("requiresGlobalBoost"), - "languageBoosts": obj.get("languageBoosts") + "languageBoosts": obj.get("languageBoosts"), + "kayzenAudienceIds": obj.get("kayzenAudienceIds") }) return _obj diff --git a/src/rapidata/api_client/models/get_job_by_id_endpoint_output.py b/src/rapidata/api_client/models/get_job_by_id_endpoint_output.py new file mode 100644 index 00000000..f1859dbf --- /dev/null +++ b/src/rapidata/api_client/models/get_job_by_id_endpoint_output.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class GetJobByIdEndpointOutput(BaseModel): + """ + GetJobByIdEndpointOutput + """ # noqa: E501 + job_id: StrictStr = Field(alias="jobId") + name: StrictStr + definition_id: StrictStr = Field(alias="definitionId") + audience_id: StrictStr = Field(alias="audienceId") + revision_number: StrictInt = Field(alias="revisionNumber") + pipeline_id: StrictStr = Field(alias="pipelineId") + status: StrictStr + completed_at: Optional[datetime] = Field(default=None, alias="completedAt") + result_file_name: Optional[StrictStr] = Field(default=None, alias="resultFileName") + failed_at: Optional[datetime] = Field(default=None, alias="failedAt") + failure_message: Optional[StrictStr] = Field(default=None, alias="failureMessage") + created_at: datetime = Field(alias="createdAt") + __properties: ClassVar[List[str]] = ["jobId", "name", "definitionId", "audienceId", "revisionNumber", "pipelineId", "status", "completedAt", "resultFileName", "failedAt", "failureMessage", "createdAt"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetJobByIdEndpointOutput from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if completed_at (nullable) is None + # and model_fields_set contains the field + if self.completed_at is None and "completed_at" in self.model_fields_set: + _dict['completedAt'] = None + + # set to None if result_file_name (nullable) is None + # and model_fields_set contains the field + if self.result_file_name is None and "result_file_name" in self.model_fields_set: + _dict['resultFileName'] = None + + # set to None if failed_at (nullable) is None + # and model_fields_set contains the field + if self.failed_at is None and "failed_at" in self.model_fields_set: + _dict['failedAt'] = None + + # set to None if failure_message (nullable) is None + # and model_fields_set contains the field + if self.failure_message is None and "failure_message" in self.model_fields_set: + _dict['failureMessage'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetJobByIdEndpointOutput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "jobId": obj.get("jobId"), + "name": obj.get("name"), + "definitionId": obj.get("definitionId"), + "audienceId": obj.get("audienceId"), + "revisionNumber": obj.get("revisionNumber"), + "pipelineId": obj.get("pipelineId"), + "status": obj.get("status"), + "completedAt": obj.get("completedAt"), + "resultFileName": obj.get("resultFileName"), + "failedAt": obj.get("failedAt"), + "failureMessage": obj.get("failureMessage"), + "createdAt": obj.get("createdAt") + }) + return _obj + + diff --git a/src/rapidata/api_client/models/get_validation_rapids_result.py b/src/rapidata/api_client/models/get_validation_rapids_result.py index c5974838..b3c20c01 100644 --- a/src/rapidata/api_client/models/get_validation_rapids_result.py +++ b/src/rapidata/api_client/models/get_validation_rapids_result.py @@ -21,7 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Union from rapidata.api_client.models.i_asset_model import IAssetModel from rapidata.api_client.models.i_rapid_payload import IRapidPayload -from rapidata.api_client.models.i_validation_truth import IValidationTruth +from rapidata.api_client.models.i_validation_truth_model import IValidationTruthModel from rapidata.api_client.models.rapid_state import RapidState from typing import Optional, Set from typing_extensions import Self @@ -33,7 +33,7 @@ class GetValidationRapidsResult(BaseModel): id: StrictStr type: StrictStr asset: Optional[IAssetModel] - truth: Optional[IValidationTruth] = None + truth: Optional[IValidationTruthModel] = None payload: IRapidPayload context: Optional[StrictStr] = None context_asset: Optional[IAssetModel] = Field(default=None, alias="contextAsset") @@ -135,7 +135,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "id": obj.get("id"), "type": obj.get("type"), "asset": IAssetModel.from_dict(obj["asset"]) if obj.get("asset") is not None else None, - "truth": IValidationTruth.from_dict(obj["truth"]) if obj.get("truth") is not None else None, + "truth": IValidationTruthModel.from_dict(obj["truth"]) if obj.get("truth") is not None else None, "payload": IRapidPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None, "context": obj.get("context"), "contextAsset": IAssetModel.from_dict(obj["contextAsset"]) if obj.get("contextAsset") is not None else None, diff --git a/src/rapidata/api_client/models/i_campaign_filter.py b/src/rapidata/api_client/models/i_campaign_filter.py index 72214c13..6a206662 100644 --- a/src/rapidata/api_client/models/i_campaign_filter.py +++ b/src/rapidata/api_client/models/i_campaign_filter.py @@ -25,12 +25,11 @@ from rapidata.api_client.models.i_campaign_filter_response_count_filter import ICampaignFilterResponseCountFilter from rapidata.api_client.models.i_campaign_filter_user_action_restriction_filter import ICampaignFilterUserActionRestrictionFilter from rapidata.api_client.models.i_campaign_filter_user_score_filter import ICampaignFilterUserScoreFilter -from rapidata.api_client.models.i_campaign_filter_user_state_filter import ICampaignFilterUserStateFilter from pydantic import StrictStr, Field from typing import Union, List, Set, Optional, Dict from typing_extensions import Literal, Self -ICAMPAIGNFILTER_ONE_OF_SCHEMAS = ["ICampaignFilterAndFilter", "ICampaignFilterCampaignFilter", "ICampaignFilterCountryFilter", "ICampaignFilterDemographicFilter", "ICampaignFilterLanguageFilter", "ICampaignFilterNewUserFilter", "ICampaignFilterNotFilter", "ICampaignFilterOrFilter", "ICampaignFilterResponseCountFilter", "ICampaignFilterUserActionRestrictionFilter", "ICampaignFilterUserScoreFilter", "ICampaignFilterUserStateFilter"] +ICAMPAIGNFILTER_ONE_OF_SCHEMAS = ["ICampaignFilterAndFilter", "ICampaignFilterCampaignFilter", "ICampaignFilterCountryFilter", "ICampaignFilterDemographicFilter", "ICampaignFilterLanguageFilter", "ICampaignFilterNewUserFilter", "ICampaignFilterNotFilter", "ICampaignFilterOrFilter", "ICampaignFilterResponseCountFilter", "ICampaignFilterUserActionRestrictionFilter", "ICampaignFilterUserScoreFilter"] class ICampaignFilter(BaseModel): """ @@ -58,10 +57,8 @@ class ICampaignFilter(BaseModel): oneof_schema_10_validator: Optional[ICampaignFilterUserActionRestrictionFilter] = None # data type: ICampaignFilterUserScoreFilter oneof_schema_11_validator: Optional[ICampaignFilterUserScoreFilter] = None - # data type: ICampaignFilterUserStateFilter - oneof_schema_12_validator: Optional[ICampaignFilterUserStateFilter] = None - actual_instance: Optional[Union[ICampaignFilterAndFilter, ICampaignFilterCampaignFilter, ICampaignFilterCountryFilter, ICampaignFilterDemographicFilter, ICampaignFilterLanguageFilter, ICampaignFilterNewUserFilter, ICampaignFilterNotFilter, ICampaignFilterOrFilter, ICampaignFilterResponseCountFilter, ICampaignFilterUserActionRestrictionFilter, ICampaignFilterUserScoreFilter, ICampaignFilterUserStateFilter]] = None - one_of_schemas: Set[str] = { "ICampaignFilterAndFilter", "ICampaignFilterCampaignFilter", "ICampaignFilterCountryFilter", "ICampaignFilterDemographicFilter", "ICampaignFilterLanguageFilter", "ICampaignFilterNewUserFilter", "ICampaignFilterNotFilter", "ICampaignFilterOrFilter", "ICampaignFilterResponseCountFilter", "ICampaignFilterUserActionRestrictionFilter", "ICampaignFilterUserScoreFilter", "ICampaignFilterUserStateFilter" } + actual_instance: Optional[Union[ICampaignFilterAndFilter, ICampaignFilterCampaignFilter, ICampaignFilterCountryFilter, ICampaignFilterDemographicFilter, ICampaignFilterLanguageFilter, ICampaignFilterNewUserFilter, ICampaignFilterNotFilter, ICampaignFilterOrFilter, ICampaignFilterResponseCountFilter, ICampaignFilterUserActionRestrictionFilter, ICampaignFilterUserScoreFilter]] = None + one_of_schemas: Set[str] = { "ICampaignFilterAndFilter", "ICampaignFilterCampaignFilter", "ICampaignFilterCountryFilter", "ICampaignFilterDemographicFilter", "ICampaignFilterLanguageFilter", "ICampaignFilterNewUserFilter", "ICampaignFilterNotFilter", "ICampaignFilterOrFilter", "ICampaignFilterResponseCountFilter", "ICampaignFilterUserActionRestrictionFilter", "ICampaignFilterUserScoreFilter" } model_config = ConfigDict( validate_assignment=True, @@ -142,17 +139,12 @@ def actual_instance_must_validate_oneof(cls, v): error_messages.append(f"Error! Input type `{type(v)}` is not `ICampaignFilterUserScoreFilter`") else: match += 1 - # validate data type: ICampaignFilterUserStateFilter - if not isinstance(v, ICampaignFilterUserStateFilter): - error_messages.append(f"Error! Input type `{type(v)}` is not `ICampaignFilterUserStateFilter`") - else: - match += 1 if match > 1: # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in ICampaignFilter with oneOf schemas: ICampaignFilterAndFilter, ICampaignFilterCampaignFilter, ICampaignFilterCountryFilter, ICampaignFilterDemographicFilter, ICampaignFilterLanguageFilter, ICampaignFilterNewUserFilter, ICampaignFilterNotFilter, ICampaignFilterOrFilter, ICampaignFilterResponseCountFilter, ICampaignFilterUserActionRestrictionFilter, ICampaignFilterUserScoreFilter, ICampaignFilterUserStateFilter. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in ICampaignFilter with oneOf schemas: ICampaignFilterAndFilter, ICampaignFilterCampaignFilter, ICampaignFilterCountryFilter, ICampaignFilterDemographicFilter, ICampaignFilterLanguageFilter, ICampaignFilterNewUserFilter, ICampaignFilterNotFilter, ICampaignFilterOrFilter, ICampaignFilterResponseCountFilter, ICampaignFilterUserActionRestrictionFilter, ICampaignFilterUserScoreFilter. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when setting `actual_instance` in ICampaignFilter with oneOf schemas: ICampaignFilterAndFilter, ICampaignFilterCampaignFilter, ICampaignFilterCountryFilter, ICampaignFilterDemographicFilter, ICampaignFilterLanguageFilter, ICampaignFilterNewUserFilter, ICampaignFilterNotFilter, ICampaignFilterOrFilter, ICampaignFilterResponseCountFilter, ICampaignFilterUserActionRestrictionFilter, ICampaignFilterUserScoreFilter, ICampaignFilterUserStateFilter. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in ICampaignFilter with oneOf schemas: ICampaignFilterAndFilter, ICampaignFilterCampaignFilter, ICampaignFilterCountryFilter, ICampaignFilterDemographicFilter, ICampaignFilterLanguageFilter, ICampaignFilterNewUserFilter, ICampaignFilterNotFilter, ICampaignFilterOrFilter, ICampaignFilterResponseCountFilter, ICampaignFilterUserActionRestrictionFilter, ICampaignFilterUserScoreFilter. Details: " + ", ".join(error_messages)) else: return v @@ -233,19 +225,13 @@ def from_json(cls, json_str: str) -> Self: match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # deserialize data into ICampaignFilterUserStateFilter - try: - instance.actual_instance = ICampaignFilterUserStateFilter.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into ICampaignFilter with oneOf schemas: ICampaignFilterAndFilter, ICampaignFilterCampaignFilter, ICampaignFilterCountryFilter, ICampaignFilterDemographicFilter, ICampaignFilterLanguageFilter, ICampaignFilterNewUserFilter, ICampaignFilterNotFilter, ICampaignFilterOrFilter, ICampaignFilterResponseCountFilter, ICampaignFilterUserActionRestrictionFilter, ICampaignFilterUserScoreFilter, ICampaignFilterUserStateFilter. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when deserializing the JSON string into ICampaignFilter with oneOf schemas: ICampaignFilterAndFilter, ICampaignFilterCampaignFilter, ICampaignFilterCountryFilter, ICampaignFilterDemographicFilter, ICampaignFilterLanguageFilter, ICampaignFilterNewUserFilter, ICampaignFilterNotFilter, ICampaignFilterOrFilter, ICampaignFilterResponseCountFilter, ICampaignFilterUserActionRestrictionFilter, ICampaignFilterUserScoreFilter. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into ICampaignFilter with oneOf schemas: ICampaignFilterAndFilter, ICampaignFilterCampaignFilter, ICampaignFilterCountryFilter, ICampaignFilterDemographicFilter, ICampaignFilterLanguageFilter, ICampaignFilterNewUserFilter, ICampaignFilterNotFilter, ICampaignFilterOrFilter, ICampaignFilterResponseCountFilter, ICampaignFilterUserActionRestrictionFilter, ICampaignFilterUserScoreFilter, ICampaignFilterUserStateFilter. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into ICampaignFilter with oneOf schemas: ICampaignFilterAndFilter, ICampaignFilterCampaignFilter, ICampaignFilterCountryFilter, ICampaignFilterDemographicFilter, ICampaignFilterLanguageFilter, ICampaignFilterNewUserFilter, ICampaignFilterNotFilter, ICampaignFilterOrFilter, ICampaignFilterResponseCountFilter, ICampaignFilterUserActionRestrictionFilter, ICampaignFilterUserScoreFilter. Details: " + ", ".join(error_messages)) else: return instance @@ -259,7 +245,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], ICampaignFilterAndFilter, ICampaignFilterCampaignFilter, ICampaignFilterCountryFilter, ICampaignFilterDemographicFilter, ICampaignFilterLanguageFilter, ICampaignFilterNewUserFilter, ICampaignFilterNotFilter, ICampaignFilterOrFilter, ICampaignFilterResponseCountFilter, ICampaignFilterUserActionRestrictionFilter, ICampaignFilterUserScoreFilter, ICampaignFilterUserStateFilter]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], ICampaignFilterAndFilter, ICampaignFilterCampaignFilter, ICampaignFilterCountryFilter, ICampaignFilterDemographicFilter, ICampaignFilterLanguageFilter, ICampaignFilterNewUserFilter, ICampaignFilterNotFilter, ICampaignFilterOrFilter, ICampaignFilterResponseCountFilter, ICampaignFilterUserActionRestrictionFilter, ICampaignFilterUserScoreFilter]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/src/rapidata/api_client/models/i_metadata.py b/src/rapidata/api_client/models/i_metadata.py index d7dc3398..1f2b4fca 100644 --- a/src/rapidata/api_client/models/i_metadata.py +++ b/src/rapidata/api_client/models/i_metadata.py @@ -19,6 +19,7 @@ from typing import Any, List, Optional from rapidata.api_client.models.i_metadata_classification_metadata import IMetadataClassificationMetadata from rapidata.api_client.models.i_metadata_count_metadata import IMetadataCountMetadata +from rapidata.api_client.models.i_metadata_duration_metadata import IMetadataDurationMetadata from rapidata.api_client.models.i_metadata_file_type_metadata import IMetadataFileTypeMetadata from rapidata.api_client.models.i_metadata_image_dimension_metadata import IMetadataImageDimensionMetadata from rapidata.api_client.models.i_metadata_location_metadata import IMetadataLocationMetadata @@ -26,12 +27,11 @@ from rapidata.api_client.models.i_metadata_source_url_metadata import IMetadataSourceUrlMetadata from rapidata.api_client.models.i_metadata_streams_metadata import IMetadataStreamsMetadata from rapidata.api_client.models.i_metadata_text_metadata import IMetadataTextMetadata -from rapidata.api_client.models.i_metadata_video_duration_metadata import IMetadataVideoDurationMetadata from pydantic import StrictStr, Field from typing import Union, List, Set, Optional, Dict from typing_extensions import Literal, Self -IMETADATA_ONE_OF_SCHEMAS = ["IMetadataClassificationMetadata", "IMetadataCountMetadata", "IMetadataFileTypeMetadata", "IMetadataImageDimensionMetadata", "IMetadataLocationMetadata", "IMetadataOriginalFilenameMetadata", "IMetadataSourceUrlMetadata", "IMetadataStreamsMetadata", "IMetadataTextMetadata", "IMetadataVideoDurationMetadata"] +IMETADATA_ONE_OF_SCHEMAS = ["IMetadataClassificationMetadata", "IMetadataCountMetadata", "IMetadataDurationMetadata", "IMetadataFileTypeMetadata", "IMetadataImageDimensionMetadata", "IMetadataLocationMetadata", "IMetadataOriginalFilenameMetadata", "IMetadataSourceUrlMetadata", "IMetadataStreamsMetadata", "IMetadataTextMetadata"] class IMetadata(BaseModel): """ @@ -41,24 +41,24 @@ class IMetadata(BaseModel): oneof_schema_1_validator: Optional[IMetadataClassificationMetadata] = None # data type: IMetadataCountMetadata oneof_schema_2_validator: Optional[IMetadataCountMetadata] = None + # data type: IMetadataDurationMetadata + oneof_schema_3_validator: Optional[IMetadataDurationMetadata] = None # data type: IMetadataFileTypeMetadata - oneof_schema_3_validator: Optional[IMetadataFileTypeMetadata] = None + oneof_schema_4_validator: Optional[IMetadataFileTypeMetadata] = None # data type: IMetadataImageDimensionMetadata - oneof_schema_4_validator: Optional[IMetadataImageDimensionMetadata] = None + oneof_schema_5_validator: Optional[IMetadataImageDimensionMetadata] = None # data type: IMetadataLocationMetadata - oneof_schema_5_validator: Optional[IMetadataLocationMetadata] = None + oneof_schema_6_validator: Optional[IMetadataLocationMetadata] = None # data type: IMetadataOriginalFilenameMetadata - oneof_schema_6_validator: Optional[IMetadataOriginalFilenameMetadata] = None + oneof_schema_7_validator: Optional[IMetadataOriginalFilenameMetadata] = None # data type: IMetadataSourceUrlMetadata - oneof_schema_7_validator: Optional[IMetadataSourceUrlMetadata] = None + oneof_schema_8_validator: Optional[IMetadataSourceUrlMetadata] = None # data type: IMetadataStreamsMetadata - oneof_schema_8_validator: Optional[IMetadataStreamsMetadata] = None + oneof_schema_9_validator: Optional[IMetadataStreamsMetadata] = None # data type: IMetadataTextMetadata - oneof_schema_9_validator: Optional[IMetadataTextMetadata] = None - # data type: IMetadataVideoDurationMetadata - oneof_schema_10_validator: Optional[IMetadataVideoDurationMetadata] = None - actual_instance: Optional[Union[IMetadataClassificationMetadata, IMetadataCountMetadata, IMetadataFileTypeMetadata, IMetadataImageDimensionMetadata, IMetadataLocationMetadata, IMetadataOriginalFilenameMetadata, IMetadataSourceUrlMetadata, IMetadataStreamsMetadata, IMetadataTextMetadata, IMetadataVideoDurationMetadata]] = None - one_of_schemas: Set[str] = { "IMetadataClassificationMetadata", "IMetadataCountMetadata", "IMetadataFileTypeMetadata", "IMetadataImageDimensionMetadata", "IMetadataLocationMetadata", "IMetadataOriginalFilenameMetadata", "IMetadataSourceUrlMetadata", "IMetadataStreamsMetadata", "IMetadataTextMetadata", "IMetadataVideoDurationMetadata" } + oneof_schema_10_validator: Optional[IMetadataTextMetadata] = None + actual_instance: Optional[Union[IMetadataClassificationMetadata, IMetadataCountMetadata, IMetadataDurationMetadata, IMetadataFileTypeMetadata, IMetadataImageDimensionMetadata, IMetadataLocationMetadata, IMetadataOriginalFilenameMetadata, IMetadataSourceUrlMetadata, IMetadataStreamsMetadata, IMetadataTextMetadata]] = None + one_of_schemas: Set[str] = { "IMetadataClassificationMetadata", "IMetadataCountMetadata", "IMetadataDurationMetadata", "IMetadataFileTypeMetadata", "IMetadataImageDimensionMetadata", "IMetadataLocationMetadata", "IMetadataOriginalFilenameMetadata", "IMetadataSourceUrlMetadata", "IMetadataStreamsMetadata", "IMetadataTextMetadata" } model_config = ConfigDict( validate_assignment=True, @@ -94,6 +94,11 @@ def actual_instance_must_validate_oneof(cls, v): error_messages.append(f"Error! Input type `{type(v)}` is not `IMetadataCountMetadata`") else: match += 1 + # validate data type: IMetadataDurationMetadata + if not isinstance(v, IMetadataDurationMetadata): + error_messages.append(f"Error! Input type `{type(v)}` is not `IMetadataDurationMetadata`") + else: + match += 1 # validate data type: IMetadataFileTypeMetadata if not isinstance(v, IMetadataFileTypeMetadata): error_messages.append(f"Error! Input type `{type(v)}` is not `IMetadataFileTypeMetadata`") @@ -129,17 +134,12 @@ def actual_instance_must_validate_oneof(cls, v): error_messages.append(f"Error! Input type `{type(v)}` is not `IMetadataTextMetadata`") else: match += 1 - # validate data type: IMetadataVideoDurationMetadata - if not isinstance(v, IMetadataVideoDurationMetadata): - error_messages.append(f"Error! Input type `{type(v)}` is not `IMetadataVideoDurationMetadata`") - else: - match += 1 if match > 1: # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in IMetadata with oneOf schemas: IMetadataClassificationMetadata, IMetadataCountMetadata, IMetadataFileTypeMetadata, IMetadataImageDimensionMetadata, IMetadataLocationMetadata, IMetadataOriginalFilenameMetadata, IMetadataSourceUrlMetadata, IMetadataStreamsMetadata, IMetadataTextMetadata, IMetadataVideoDurationMetadata. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in IMetadata with oneOf schemas: IMetadataClassificationMetadata, IMetadataCountMetadata, IMetadataDurationMetadata, IMetadataFileTypeMetadata, IMetadataImageDimensionMetadata, IMetadataLocationMetadata, IMetadataOriginalFilenameMetadata, IMetadataSourceUrlMetadata, IMetadataStreamsMetadata, IMetadataTextMetadata. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when setting `actual_instance` in IMetadata with oneOf schemas: IMetadataClassificationMetadata, IMetadataCountMetadata, IMetadataFileTypeMetadata, IMetadataImageDimensionMetadata, IMetadataLocationMetadata, IMetadataOriginalFilenameMetadata, IMetadataSourceUrlMetadata, IMetadataStreamsMetadata, IMetadataTextMetadata, IMetadataVideoDurationMetadata. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in IMetadata with oneOf schemas: IMetadataClassificationMetadata, IMetadataCountMetadata, IMetadataDurationMetadata, IMetadataFileTypeMetadata, IMetadataImageDimensionMetadata, IMetadataLocationMetadata, IMetadataOriginalFilenameMetadata, IMetadataSourceUrlMetadata, IMetadataStreamsMetadata, IMetadataTextMetadata. Details: " + ", ".join(error_messages)) else: return v @@ -166,6 +166,12 @@ def from_json(cls, json_str: str) -> Self: match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) + # deserialize data into IMetadataDurationMetadata + try: + instance.actual_instance = IMetadataDurationMetadata.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) # deserialize data into IMetadataFileTypeMetadata try: instance.actual_instance = IMetadataFileTypeMetadata.from_json(json_str) @@ -208,19 +214,13 @@ def from_json(cls, json_str: str) -> Self: match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # deserialize data into IMetadataVideoDurationMetadata - try: - instance.actual_instance = IMetadataVideoDurationMetadata.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into IMetadata with oneOf schemas: IMetadataClassificationMetadata, IMetadataCountMetadata, IMetadataFileTypeMetadata, IMetadataImageDimensionMetadata, IMetadataLocationMetadata, IMetadataOriginalFilenameMetadata, IMetadataSourceUrlMetadata, IMetadataStreamsMetadata, IMetadataTextMetadata, IMetadataVideoDurationMetadata. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when deserializing the JSON string into IMetadata with oneOf schemas: IMetadataClassificationMetadata, IMetadataCountMetadata, IMetadataDurationMetadata, IMetadataFileTypeMetadata, IMetadataImageDimensionMetadata, IMetadataLocationMetadata, IMetadataOriginalFilenameMetadata, IMetadataSourceUrlMetadata, IMetadataStreamsMetadata, IMetadataTextMetadata. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into IMetadata with oneOf schemas: IMetadataClassificationMetadata, IMetadataCountMetadata, IMetadataFileTypeMetadata, IMetadataImageDimensionMetadata, IMetadataLocationMetadata, IMetadataOriginalFilenameMetadata, IMetadataSourceUrlMetadata, IMetadataStreamsMetadata, IMetadataTextMetadata, IMetadataVideoDurationMetadata. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into IMetadata with oneOf schemas: IMetadataClassificationMetadata, IMetadataCountMetadata, IMetadataDurationMetadata, IMetadataFileTypeMetadata, IMetadataImageDimensionMetadata, IMetadataLocationMetadata, IMetadataOriginalFilenameMetadata, IMetadataSourceUrlMetadata, IMetadataStreamsMetadata, IMetadataTextMetadata. Details: " + ", ".join(error_messages)) else: return instance @@ -234,7 +234,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], IMetadataClassificationMetadata, IMetadataCountMetadata, IMetadataFileTypeMetadata, IMetadataImageDimensionMetadata, IMetadataLocationMetadata, IMetadataOriginalFilenameMetadata, IMetadataSourceUrlMetadata, IMetadataStreamsMetadata, IMetadataTextMetadata, IMetadataVideoDurationMetadata]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], IMetadataClassificationMetadata, IMetadataCountMetadata, IMetadataDurationMetadata, IMetadataFileTypeMetadata, IMetadataImageDimensionMetadata, IMetadataLocationMetadata, IMetadataOriginalFilenameMetadata, IMetadataSourceUrlMetadata, IMetadataStreamsMetadata, IMetadataTextMetadata]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/src/rapidata/api_client/models/i_metadata_duration_metadata.py b/src/rapidata/api_client/models/i_metadata_duration_metadata.py new file mode 100644 index 00000000..439bcb32 --- /dev/null +++ b/src/rapidata/api_client/models/i_metadata_duration_metadata.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class IMetadataDurationMetadata(BaseModel): + """ + IMetadataDurationMetadata + """ # noqa: E501 + t: StrictStr = Field(alias="_t") + duration: datetime + visibilities: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["_t", "duration", "visibilities"] + + @field_validator('t') + def t_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['DurationMetadata']): + raise ValueError("must be one of enum values ('DurationMetadata')") + return value + + @field_validator('visibilities') + def visibilities_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['None', 'Users', 'Customers', 'Admins', 'Dashboard', 'All']): + raise ValueError("each list item must be one of ('None', 'Users', 'Customers', 'Admins', 'Dashboard', 'All')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IMetadataDurationMetadata from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IMetadataDurationMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_t": obj.get("_t"), + "duration": obj.get("duration"), + "visibilities": obj.get("visibilities") + }) + return _obj + + diff --git a/src/rapidata/api_client/models/i_validation_truth_locate_box_truth.py b/src/rapidata/api_client/models/i_validation_truth_locate_box_truth.py index 34fcdb64..551291e3 100644 --- a/src/rapidata/api_client/models/i_validation_truth_locate_box_truth.py +++ b/src/rapidata/api_client/models/i_validation_truth_locate_box_truth.py @@ -17,8 +17,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union from rapidata.api_client.models.box_shape import BoxShape from typing import Optional, Set from typing_extensions import Self @@ -29,7 +29,9 @@ class IValidationTruthLocateBoxTruth(BaseModel): """ # noqa: E501 t: StrictStr = Field(alias="_t") bounding_boxes: List[BoxShape] = Field(alias="boundingBoxes") - __properties: ClassVar[List[str]] = ["_t", "boundingBoxes"] + required_precision: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="requiredPrecision") + required_completeness: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="requiredCompleteness") + __properties: ClassVar[List[str]] = ["_t", "boundingBoxes", "requiredPrecision", "requiredCompleteness"] @field_validator('t') def t_validate_enum(cls, value): @@ -97,7 +99,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "_t": obj.get("_t"), - "boundingBoxes": [BoxShape.from_dict(_item) for _item in obj["boundingBoxes"]] if obj.get("boundingBoxes") is not None else None + "boundingBoxes": [BoxShape.from_dict(_item) for _item in obj["boundingBoxes"]] if obj.get("boundingBoxes") is not None else None, + "requiredPrecision": obj.get("requiredPrecision"), + "requiredCompleteness": obj.get("requiredCompleteness") }) return _obj diff --git a/src/rapidata/api_client/models/i_validation_truth_model.py b/src/rapidata/api_client/models/i_validation_truth_model.py new file mode 100644 index 00000000..b33ed66f --- /dev/null +++ b/src/rapidata/api_client/models/i_validation_truth_model.py @@ -0,0 +1,294 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from rapidata.api_client.models.i_validation_truth_model_attach_category_truth_model import IValidationTruthModelAttachCategoryTruthModel +from rapidata.api_client.models.i_validation_truth_model_bounding_box_truth_model import IValidationTruthModelBoundingBoxTruthModel +from rapidata.api_client.models.i_validation_truth_model_classify_truth_model import IValidationTruthModelClassifyTruthModel +from rapidata.api_client.models.i_validation_truth_model_compare_truth_model import IValidationTruthModelCompareTruthModel +from rapidata.api_client.models.i_validation_truth_model_empty_validation_truth_model import IValidationTruthModelEmptyValidationTruthModel +from rapidata.api_client.models.i_validation_truth_model_line_truth_model import IValidationTruthModelLineTruthModel +from rapidata.api_client.models.i_validation_truth_model_locate_box_truth_model import IValidationTruthModelLocateBoxTruthModel +from rapidata.api_client.models.i_validation_truth_model_multi_compare_truth_model import IValidationTruthModelMultiCompareTruthModel +from rapidata.api_client.models.i_validation_truth_model_named_entity_truth_model import IValidationTruthModelNamedEntityTruthModel +from rapidata.api_client.models.i_validation_truth_model_polygon_truth_model import IValidationTruthModelPolygonTruthModel +from rapidata.api_client.models.i_validation_truth_model_scrub_truth_model import IValidationTruthModelScrubTruthModel +from rapidata.api_client.models.i_validation_truth_model_skip_truth_model import IValidationTruthModelSkipTruthModel +from rapidata.api_client.models.i_validation_truth_model_transcription_truth_model import IValidationTruthModelTranscriptionTruthModel +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +IVALIDATIONTRUTHMODEL_ONE_OF_SCHEMAS = ["IValidationTruthModelAttachCategoryTruthModel", "IValidationTruthModelBoundingBoxTruthModel", "IValidationTruthModelClassifyTruthModel", "IValidationTruthModelCompareTruthModel", "IValidationTruthModelEmptyValidationTruthModel", "IValidationTruthModelLineTruthModel", "IValidationTruthModelLocateBoxTruthModel", "IValidationTruthModelMultiCompareTruthModel", "IValidationTruthModelNamedEntityTruthModel", "IValidationTruthModelPolygonTruthModel", "IValidationTruthModelScrubTruthModel", "IValidationTruthModelSkipTruthModel", "IValidationTruthModelTranscriptionTruthModel"] + +class IValidationTruthModel(BaseModel): + """ + IValidationTruthModel + """ + # data type: IValidationTruthModelAttachCategoryTruthModel + oneof_schema_1_validator: Optional[IValidationTruthModelAttachCategoryTruthModel] = None + # data type: IValidationTruthModelBoundingBoxTruthModel + oneof_schema_2_validator: Optional[IValidationTruthModelBoundingBoxTruthModel] = None + # data type: IValidationTruthModelClassifyTruthModel + oneof_schema_3_validator: Optional[IValidationTruthModelClassifyTruthModel] = None + # data type: IValidationTruthModelCompareTruthModel + oneof_schema_4_validator: Optional[IValidationTruthModelCompareTruthModel] = None + # data type: IValidationTruthModelEmptyValidationTruthModel + oneof_schema_5_validator: Optional[IValidationTruthModelEmptyValidationTruthModel] = None + # data type: IValidationTruthModelLineTruthModel + oneof_schema_6_validator: Optional[IValidationTruthModelLineTruthModel] = None + # data type: IValidationTruthModelLocateBoxTruthModel + oneof_schema_7_validator: Optional[IValidationTruthModelLocateBoxTruthModel] = None + # data type: IValidationTruthModelMultiCompareTruthModel + oneof_schema_8_validator: Optional[IValidationTruthModelMultiCompareTruthModel] = None + # data type: IValidationTruthModelNamedEntityTruthModel + oneof_schema_9_validator: Optional[IValidationTruthModelNamedEntityTruthModel] = None + # data type: IValidationTruthModelPolygonTruthModel + oneof_schema_10_validator: Optional[IValidationTruthModelPolygonTruthModel] = None + # data type: IValidationTruthModelScrubTruthModel + oneof_schema_11_validator: Optional[IValidationTruthModelScrubTruthModel] = None + # data type: IValidationTruthModelSkipTruthModel + oneof_schema_12_validator: Optional[IValidationTruthModelSkipTruthModel] = None + # data type: IValidationTruthModelTranscriptionTruthModel + oneof_schema_13_validator: Optional[IValidationTruthModelTranscriptionTruthModel] = None + actual_instance: Optional[Union[IValidationTruthModelAttachCategoryTruthModel, IValidationTruthModelBoundingBoxTruthModel, IValidationTruthModelClassifyTruthModel, IValidationTruthModelCompareTruthModel, IValidationTruthModelEmptyValidationTruthModel, IValidationTruthModelLineTruthModel, IValidationTruthModelLocateBoxTruthModel, IValidationTruthModelMultiCompareTruthModel, IValidationTruthModelNamedEntityTruthModel, IValidationTruthModelPolygonTruthModel, IValidationTruthModelScrubTruthModel, IValidationTruthModelSkipTruthModel, IValidationTruthModelTranscriptionTruthModel]] = None + one_of_schemas: Set[str] = { "IValidationTruthModelAttachCategoryTruthModel", "IValidationTruthModelBoundingBoxTruthModel", "IValidationTruthModelClassifyTruthModel", "IValidationTruthModelCompareTruthModel", "IValidationTruthModelEmptyValidationTruthModel", "IValidationTruthModelLineTruthModel", "IValidationTruthModelLocateBoxTruthModel", "IValidationTruthModelMultiCompareTruthModel", "IValidationTruthModelNamedEntityTruthModel", "IValidationTruthModelPolygonTruthModel", "IValidationTruthModelScrubTruthModel", "IValidationTruthModelSkipTruthModel", "IValidationTruthModelTranscriptionTruthModel" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = IValidationTruthModel.model_construct() + error_messages = [] + match = 0 + # validate data type: IValidationTruthModelAttachCategoryTruthModel + if not isinstance(v, IValidationTruthModelAttachCategoryTruthModel): + error_messages.append(f"Error! Input type `{type(v)}` is not `IValidationTruthModelAttachCategoryTruthModel`") + else: + match += 1 + # validate data type: IValidationTruthModelBoundingBoxTruthModel + if not isinstance(v, IValidationTruthModelBoundingBoxTruthModel): + error_messages.append(f"Error! Input type `{type(v)}` is not `IValidationTruthModelBoundingBoxTruthModel`") + else: + match += 1 + # validate data type: IValidationTruthModelClassifyTruthModel + if not isinstance(v, IValidationTruthModelClassifyTruthModel): + error_messages.append(f"Error! Input type `{type(v)}` is not `IValidationTruthModelClassifyTruthModel`") + else: + match += 1 + # validate data type: IValidationTruthModelCompareTruthModel + if not isinstance(v, IValidationTruthModelCompareTruthModel): + error_messages.append(f"Error! Input type `{type(v)}` is not `IValidationTruthModelCompareTruthModel`") + else: + match += 1 + # validate data type: IValidationTruthModelEmptyValidationTruthModel + if not isinstance(v, IValidationTruthModelEmptyValidationTruthModel): + error_messages.append(f"Error! Input type `{type(v)}` is not `IValidationTruthModelEmptyValidationTruthModel`") + else: + match += 1 + # validate data type: IValidationTruthModelLineTruthModel + if not isinstance(v, IValidationTruthModelLineTruthModel): + error_messages.append(f"Error! Input type `{type(v)}` is not `IValidationTruthModelLineTruthModel`") + else: + match += 1 + # validate data type: IValidationTruthModelLocateBoxTruthModel + if not isinstance(v, IValidationTruthModelLocateBoxTruthModel): + error_messages.append(f"Error! Input type `{type(v)}` is not `IValidationTruthModelLocateBoxTruthModel`") + else: + match += 1 + # validate data type: IValidationTruthModelMultiCompareTruthModel + if not isinstance(v, IValidationTruthModelMultiCompareTruthModel): + error_messages.append(f"Error! Input type `{type(v)}` is not `IValidationTruthModelMultiCompareTruthModel`") + else: + match += 1 + # validate data type: IValidationTruthModelNamedEntityTruthModel + if not isinstance(v, IValidationTruthModelNamedEntityTruthModel): + error_messages.append(f"Error! Input type `{type(v)}` is not `IValidationTruthModelNamedEntityTruthModel`") + else: + match += 1 + # validate data type: IValidationTruthModelPolygonTruthModel + if not isinstance(v, IValidationTruthModelPolygonTruthModel): + error_messages.append(f"Error! Input type `{type(v)}` is not `IValidationTruthModelPolygonTruthModel`") + else: + match += 1 + # validate data type: IValidationTruthModelScrubTruthModel + if not isinstance(v, IValidationTruthModelScrubTruthModel): + error_messages.append(f"Error! Input type `{type(v)}` is not `IValidationTruthModelScrubTruthModel`") + else: + match += 1 + # validate data type: IValidationTruthModelSkipTruthModel + if not isinstance(v, IValidationTruthModelSkipTruthModel): + error_messages.append(f"Error! Input type `{type(v)}` is not `IValidationTruthModelSkipTruthModel`") + else: + match += 1 + # validate data type: IValidationTruthModelTranscriptionTruthModel + if not isinstance(v, IValidationTruthModelTranscriptionTruthModel): + error_messages.append(f"Error! Input type `{type(v)}` is not `IValidationTruthModelTranscriptionTruthModel`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in IValidationTruthModel with oneOf schemas: IValidationTruthModelAttachCategoryTruthModel, IValidationTruthModelBoundingBoxTruthModel, IValidationTruthModelClassifyTruthModel, IValidationTruthModelCompareTruthModel, IValidationTruthModelEmptyValidationTruthModel, IValidationTruthModelLineTruthModel, IValidationTruthModelLocateBoxTruthModel, IValidationTruthModelMultiCompareTruthModel, IValidationTruthModelNamedEntityTruthModel, IValidationTruthModelPolygonTruthModel, IValidationTruthModelScrubTruthModel, IValidationTruthModelSkipTruthModel, IValidationTruthModelTranscriptionTruthModel. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in IValidationTruthModel with oneOf schemas: IValidationTruthModelAttachCategoryTruthModel, IValidationTruthModelBoundingBoxTruthModel, IValidationTruthModelClassifyTruthModel, IValidationTruthModelCompareTruthModel, IValidationTruthModelEmptyValidationTruthModel, IValidationTruthModelLineTruthModel, IValidationTruthModelLocateBoxTruthModel, IValidationTruthModelMultiCompareTruthModel, IValidationTruthModelNamedEntityTruthModel, IValidationTruthModelPolygonTruthModel, IValidationTruthModelScrubTruthModel, IValidationTruthModelSkipTruthModel, IValidationTruthModelTranscriptionTruthModel. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into IValidationTruthModelAttachCategoryTruthModel + try: + instance.actual_instance = IValidationTruthModelAttachCategoryTruthModel.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into IValidationTruthModelBoundingBoxTruthModel + try: + instance.actual_instance = IValidationTruthModelBoundingBoxTruthModel.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into IValidationTruthModelClassifyTruthModel + try: + instance.actual_instance = IValidationTruthModelClassifyTruthModel.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into IValidationTruthModelCompareTruthModel + try: + instance.actual_instance = IValidationTruthModelCompareTruthModel.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into IValidationTruthModelEmptyValidationTruthModel + try: + instance.actual_instance = IValidationTruthModelEmptyValidationTruthModel.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into IValidationTruthModelLineTruthModel + try: + instance.actual_instance = IValidationTruthModelLineTruthModel.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into IValidationTruthModelLocateBoxTruthModel + try: + instance.actual_instance = IValidationTruthModelLocateBoxTruthModel.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into IValidationTruthModelMultiCompareTruthModel + try: + instance.actual_instance = IValidationTruthModelMultiCompareTruthModel.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into IValidationTruthModelNamedEntityTruthModel + try: + instance.actual_instance = IValidationTruthModelNamedEntityTruthModel.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into IValidationTruthModelPolygonTruthModel + try: + instance.actual_instance = IValidationTruthModelPolygonTruthModel.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into IValidationTruthModelScrubTruthModel + try: + instance.actual_instance = IValidationTruthModelScrubTruthModel.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into IValidationTruthModelSkipTruthModel + try: + instance.actual_instance = IValidationTruthModelSkipTruthModel.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into IValidationTruthModelTranscriptionTruthModel + try: + instance.actual_instance = IValidationTruthModelTranscriptionTruthModel.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into IValidationTruthModel with oneOf schemas: IValidationTruthModelAttachCategoryTruthModel, IValidationTruthModelBoundingBoxTruthModel, IValidationTruthModelClassifyTruthModel, IValidationTruthModelCompareTruthModel, IValidationTruthModelEmptyValidationTruthModel, IValidationTruthModelLineTruthModel, IValidationTruthModelLocateBoxTruthModel, IValidationTruthModelMultiCompareTruthModel, IValidationTruthModelNamedEntityTruthModel, IValidationTruthModelPolygonTruthModel, IValidationTruthModelScrubTruthModel, IValidationTruthModelSkipTruthModel, IValidationTruthModelTranscriptionTruthModel. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into IValidationTruthModel with oneOf schemas: IValidationTruthModelAttachCategoryTruthModel, IValidationTruthModelBoundingBoxTruthModel, IValidationTruthModelClassifyTruthModel, IValidationTruthModelCompareTruthModel, IValidationTruthModelEmptyValidationTruthModel, IValidationTruthModelLineTruthModel, IValidationTruthModelLocateBoxTruthModel, IValidationTruthModelMultiCompareTruthModel, IValidationTruthModelNamedEntityTruthModel, IValidationTruthModelPolygonTruthModel, IValidationTruthModelScrubTruthModel, IValidationTruthModelSkipTruthModel, IValidationTruthModelTranscriptionTruthModel. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], IValidationTruthModelAttachCategoryTruthModel, IValidationTruthModelBoundingBoxTruthModel, IValidationTruthModelClassifyTruthModel, IValidationTruthModelCompareTruthModel, IValidationTruthModelEmptyValidationTruthModel, IValidationTruthModelLineTruthModel, IValidationTruthModelLocateBoxTruthModel, IValidationTruthModelMultiCompareTruthModel, IValidationTruthModelNamedEntityTruthModel, IValidationTruthModelPolygonTruthModel, IValidationTruthModelScrubTruthModel, IValidationTruthModelSkipTruthModel, IValidationTruthModelTranscriptionTruthModel]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/src/rapidata/api_client/models/i_validation_truth_model_attach_category_truth_model.py b/src/rapidata/api_client/models/i_validation_truth_model_attach_category_truth_model.py new file mode 100644 index 00000000..2125f0f6 --- /dev/null +++ b/src/rapidata/api_client/models/i_validation_truth_model_attach_category_truth_model.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class IValidationTruthModelAttachCategoryTruthModel(BaseModel): + """ + IValidationTruthModelAttachCategoryTruthModel + """ # noqa: E501 + t: StrictStr = Field(alias="_t") + correct_categories: List[StrictStr] = Field(alias="correctCategories") + __properties: ClassVar[List[str]] = ["_t", "correctCategories"] + + @field_validator('t') + def t_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['AttachCategoryTruth']): + raise ValueError("must be one of enum values ('AttachCategoryTruth')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IValidationTruthModelAttachCategoryTruthModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IValidationTruthModelAttachCategoryTruthModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_t": obj.get("_t"), + "correctCategories": obj.get("correctCategories") + }) + return _obj + + diff --git a/src/rapidata/api_client/models/i_validation_truth_model_bounding_box_truth_model.py b/src/rapidata/api_client/models/i_validation_truth_model_bounding_box_truth_model.py new file mode 100644 index 00000000..89a53757 --- /dev/null +++ b/src/rapidata/api_client/models/i_validation_truth_model_bounding_box_truth_model.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self + +class IValidationTruthModelBoundingBoxTruthModel(BaseModel): + """ + IValidationTruthModelBoundingBoxTruthModel + """ # noqa: E501 + t: StrictStr = Field(alias="_t") + x_min: Union[StrictFloat, StrictInt] = Field(alias="xMin") + y_min: Union[StrictFloat, StrictInt] = Field(alias="yMin") + x_max: Union[StrictFloat, StrictInt] = Field(alias="xMax") + y_max: Union[StrictFloat, StrictInt] = Field(alias="yMax") + __properties: ClassVar[List[str]] = ["_t", "xMin", "yMin", "xMax", "yMax"] + + @field_validator('t') + def t_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['BoundingBoxTruth']): + raise ValueError("must be one of enum values ('BoundingBoxTruth')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IValidationTruthModelBoundingBoxTruthModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IValidationTruthModelBoundingBoxTruthModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_t": obj.get("_t"), + "xMin": obj.get("xMin"), + "yMin": obj.get("yMin"), + "xMax": obj.get("xMax"), + "yMax": obj.get("yMax") + }) + return _obj + + diff --git a/src/rapidata/api_client/models/i_validation_truth_model_classify_truth_model.py b/src/rapidata/api_client/models/i_validation_truth_model_classify_truth_model.py new file mode 100644 index 00000000..f62bb892 --- /dev/null +++ b/src/rapidata/api_client/models/i_validation_truth_model_classify_truth_model.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class IValidationTruthModelClassifyTruthModel(BaseModel): + """ + IValidationTruthModelClassifyTruthModel + """ # noqa: E501 + t: StrictStr = Field(alias="_t") + correct_categories: List[StrictStr] = Field(alias="correctCategories") + __properties: ClassVar[List[str]] = ["_t", "correctCategories"] + + @field_validator('t') + def t_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ClassifyTruth']): + raise ValueError("must be one of enum values ('ClassifyTruth')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IValidationTruthModelClassifyTruthModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IValidationTruthModelClassifyTruthModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_t": obj.get("_t"), + "correctCategories": obj.get("correctCategories") + }) + return _obj + + diff --git a/src/rapidata/api_client/models/i_validation_truth_model_compare_truth_model.py b/src/rapidata/api_client/models/i_validation_truth_model_compare_truth_model.py new file mode 100644 index 00000000..c2251805 --- /dev/null +++ b/src/rapidata/api_client/models/i_validation_truth_model_compare_truth_model.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class IValidationTruthModelCompareTruthModel(BaseModel): + """ + IValidationTruthModelCompareTruthModel + """ # noqa: E501 + t: StrictStr = Field(alias="_t") + winner_id: StrictStr = Field(alias="winnerId") + __properties: ClassVar[List[str]] = ["_t", "winnerId"] + + @field_validator('t') + def t_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['CompareTruth']): + raise ValueError("must be one of enum values ('CompareTruth')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IValidationTruthModelCompareTruthModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IValidationTruthModelCompareTruthModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_t": obj.get("_t"), + "winnerId": obj.get("winnerId") + }) + return _obj + + diff --git a/src/rapidata/api_client/models/i_validation_truth_model_empty_validation_truth_model.py b/src/rapidata/api_client/models/i_validation_truth_model_empty_validation_truth_model.py new file mode 100644 index 00000000..38d719f2 --- /dev/null +++ b/src/rapidata/api_client/models/i_validation_truth_model_empty_validation_truth_model.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class IValidationTruthModelEmptyValidationTruthModel(BaseModel): + """ + IValidationTruthModelEmptyValidationTruthModel + """ # noqa: E501 + t: StrictStr = Field(alias="_t") + __properties: ClassVar[List[str]] = ["_t"] + + @field_validator('t') + def t_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['EmptyValidationTruth']): + raise ValueError("must be one of enum values ('EmptyValidationTruth')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IValidationTruthModelEmptyValidationTruthModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IValidationTruthModelEmptyValidationTruthModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_t": obj.get("_t") + }) + return _obj + + diff --git a/src/rapidata/api_client/models/i_validation_truth_model_line_truth_model.py b/src/rapidata/api_client/models/i_validation_truth_model_line_truth_model.py new file mode 100644 index 00000000..45963000 --- /dev/null +++ b/src/rapidata/api_client/models/i_validation_truth_model_line_truth_model.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class IValidationTruthModelLineTruthModel(BaseModel): + """ + IValidationTruthModelLineTruthModel + """ # noqa: E501 + t: StrictStr = Field(alias="_t") + __properties: ClassVar[List[str]] = ["_t"] + + @field_validator('t') + def t_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['LineTruth']): + raise ValueError("must be one of enum values ('LineTruth')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IValidationTruthModelLineTruthModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IValidationTruthModelLineTruthModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_t": obj.get("_t") + }) + return _obj + + diff --git a/src/rapidata/api_client/models/i_validation_truth_model_locate_box_truth_model.py b/src/rapidata/api_client/models/i_validation_truth_model_locate_box_truth_model.py new file mode 100644 index 00000000..e3aac617 --- /dev/null +++ b/src/rapidata/api_client/models/i_validation_truth_model_locate_box_truth_model.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from rapidata.api_client.models.box_shape import BoxShape +from typing import Optional, Set +from typing_extensions import Self + +class IValidationTruthModelLocateBoxTruthModel(BaseModel): + """ + IValidationTruthModelLocateBoxTruthModel + """ # noqa: E501 + t: StrictStr = Field(alias="_t") + bounding_boxes: List[BoxShape] = Field(alias="boundingBoxes") + required_precision: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="requiredPrecision") + required_completeness: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="requiredCompleteness") + __properties: ClassVar[List[str]] = ["_t", "boundingBoxes", "requiredPrecision", "requiredCompleteness"] + + @field_validator('t') + def t_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['LocateBoxTruth']): + raise ValueError("must be one of enum values ('LocateBoxTruth')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IValidationTruthModelLocateBoxTruthModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in bounding_boxes (list) + _items = [] + if self.bounding_boxes: + for _item_bounding_boxes in self.bounding_boxes: + if _item_bounding_boxes: + _items.append(_item_bounding_boxes.to_dict()) + _dict['boundingBoxes'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IValidationTruthModelLocateBoxTruthModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_t": obj.get("_t"), + "boundingBoxes": [BoxShape.from_dict(_item) for _item in obj["boundingBoxes"]] if obj.get("boundingBoxes") is not None else None, + "requiredPrecision": obj.get("requiredPrecision"), + "requiredCompleteness": obj.get("requiredCompleteness") + }) + return _obj + + diff --git a/src/rapidata/api_client/models/i_validation_truth_model_multi_compare_truth_model.py b/src/rapidata/api_client/models/i_validation_truth_model_multi_compare_truth_model.py new file mode 100644 index 00000000..bb5333e9 --- /dev/null +++ b/src/rapidata/api_client/models/i_validation_truth_model_multi_compare_truth_model.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class IValidationTruthModelMultiCompareTruthModel(BaseModel): + """ + IValidationTruthModelMultiCompareTruthModel + """ # noqa: E501 + t: StrictStr = Field(alias="_t") + correct_combinations: List[List[StrictStr]] = Field(alias="correctCombinations") + __properties: ClassVar[List[str]] = ["_t", "correctCombinations"] + + @field_validator('t') + def t_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['MultiCompareTruth']): + raise ValueError("must be one of enum values ('MultiCompareTruth')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IValidationTruthModelMultiCompareTruthModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IValidationTruthModelMultiCompareTruthModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_t": obj.get("_t"), + "correctCombinations": obj.get("correctCombinations") + }) + return _obj + + diff --git a/src/rapidata/api_client/models/i_validation_truth_model_named_entity_truth_model.py b/src/rapidata/api_client/models/i_validation_truth_model_named_entity_truth_model.py new file mode 100644 index 00000000..41ba5a18 --- /dev/null +++ b/src/rapidata/api_client/models/i_validation_truth_model_named_entity_truth_model.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from rapidata.api_client.models.named_classification import NamedClassification +from typing import Optional, Set +from typing_extensions import Self + +class IValidationTruthModelNamedEntityTruthModel(BaseModel): + """ + IValidationTruthModelNamedEntityTruthModel + """ # noqa: E501 + t: StrictStr = Field(alias="_t") + classifications: List[NamedClassification] + __properties: ClassVar[List[str]] = ["_t", "classifications"] + + @field_validator('t') + def t_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['NamedEntityTruth']): + raise ValueError("must be one of enum values ('NamedEntityTruth')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IValidationTruthModelNamedEntityTruthModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in classifications (list) + _items = [] + if self.classifications: + for _item_classifications in self.classifications: + if _item_classifications: + _items.append(_item_classifications.to_dict()) + _dict['classifications'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IValidationTruthModelNamedEntityTruthModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_t": obj.get("_t"), + "classifications": [NamedClassification.from_dict(_item) for _item in obj["classifications"]] if obj.get("classifications") is not None else None + }) + return _obj + + diff --git a/src/rapidata/api_client/models/i_validation_truth_model_polygon_truth_model.py b/src/rapidata/api_client/models/i_validation_truth_model_polygon_truth_model.py new file mode 100644 index 00000000..8c49a5b2 --- /dev/null +++ b/src/rapidata/api_client/models/i_validation_truth_model_polygon_truth_model.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class IValidationTruthModelPolygonTruthModel(BaseModel): + """ + IValidationTruthModelPolygonTruthModel + """ # noqa: E501 + t: StrictStr = Field(alias="_t") + __properties: ClassVar[List[str]] = ["_t"] + + @field_validator('t') + def t_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['PolygonTruth']): + raise ValueError("must be one of enum values ('PolygonTruth')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IValidationTruthModelPolygonTruthModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IValidationTruthModelPolygonTruthModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_t": obj.get("_t") + }) + return _obj + + diff --git a/src/rapidata/api_client/models/i_validation_truth_model_scrub_truth_model.py b/src/rapidata/api_client/models/i_validation_truth_model_scrub_truth_model.py new file mode 100644 index 00000000..57bfa5bf --- /dev/null +++ b/src/rapidata/api_client/models/i_validation_truth_model_scrub_truth_model.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from rapidata.api_client.models.scrub_range import ScrubRange +from typing import Optional, Set +from typing_extensions import Self + +class IValidationTruthModelScrubTruthModel(BaseModel): + """ + IValidationTruthModelScrubTruthModel + """ # noqa: E501 + t: StrictStr = Field(alias="_t") + valid_ranges: List[ScrubRange] = Field(alias="validRanges") + __properties: ClassVar[List[str]] = ["_t", "validRanges"] + + @field_validator('t') + def t_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ScrubTruth']): + raise ValueError("must be one of enum values ('ScrubTruth')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IValidationTruthModelScrubTruthModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in valid_ranges (list) + _items = [] + if self.valid_ranges: + for _item_valid_ranges in self.valid_ranges: + if _item_valid_ranges: + _items.append(_item_valid_ranges.to_dict()) + _dict['validRanges'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IValidationTruthModelScrubTruthModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_t": obj.get("_t"), + "validRanges": [ScrubRange.from_dict(_item) for _item in obj["validRanges"]] if obj.get("validRanges") is not None else None + }) + return _obj + + diff --git a/src/rapidata/api_client/models/i_validation_truth_model_skip_truth_model.py b/src/rapidata/api_client/models/i_validation_truth_model_skip_truth_model.py new file mode 100644 index 00000000..a8aea4c4 --- /dev/null +++ b/src/rapidata/api_client/models/i_validation_truth_model_skip_truth_model.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class IValidationTruthModelSkipTruthModel(BaseModel): + """ + IValidationTruthModelSkipTruthModel + """ # noqa: E501 + t: StrictStr = Field(alias="_t") + __properties: ClassVar[List[str]] = ["_t"] + + @field_validator('t') + def t_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['SkipTruth']): + raise ValueError("must be one of enum values ('SkipTruth')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IValidationTruthModelSkipTruthModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IValidationTruthModelSkipTruthModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_t": obj.get("_t") + }) + return _obj + + diff --git a/src/rapidata/api_client/models/i_validation_truth_model_transcription_truth_model.py b/src/rapidata/api_client/models/i_validation_truth_model_transcription_truth_model.py new file mode 100644 index 00000000..adb4e41e --- /dev/null +++ b/src/rapidata/api_client/models/i_validation_truth_model_transcription_truth_model.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from rapidata.api_client.models.transcription_word import TranscriptionWord +from typing import Optional, Set +from typing_extensions import Self + +class IValidationTruthModelTranscriptionTruthModel(BaseModel): + """ + IValidationTruthModelTranscriptionTruthModel + """ # noqa: E501 + t: StrictStr = Field(alias="_t") + correct_words: List[TranscriptionWord] = Field(alias="correctWords") + strict_grading: Optional[StrictBool] = Field(default=None, alias="strictGrading") + required_precision: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="requiredPrecision") + required_completeness: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="requiredCompleteness") + __properties: ClassVar[List[str]] = ["_t", "correctWords", "strictGrading", "requiredPrecision", "requiredCompleteness"] + + @field_validator('t') + def t_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['TranscriptionTruth']): + raise ValueError("must be one of enum values ('TranscriptionTruth')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IValidationTruthModelTranscriptionTruthModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in correct_words (list) + _items = [] + if self.correct_words: + for _item_correct_words in self.correct_words: + if _item_correct_words: + _items.append(_item_correct_words.to_dict()) + _dict['correctWords'] = _items + # set to None if strict_grading (nullable) is None + # and model_fields_set contains the field + if self.strict_grading is None and "strict_grading" in self.model_fields_set: + _dict['strictGrading'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IValidationTruthModelTranscriptionTruthModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_t": obj.get("_t"), + "correctWords": [TranscriptionWord.from_dict(_item) for _item in obj["correctWords"]] if obj.get("correctWords") is not None else None, + "strictGrading": obj.get("strictGrading"), + "requiredPrecision": obj.get("requiredPrecision"), + "requiredCompleteness": obj.get("requiredCompleteness") + }) + return _obj + + diff --git a/src/rapidata/api_client/models/query_jobs_result.py b/src/rapidata/api_client/models/query_jobs_result.py index e34d2747..f113db0f 100644 --- a/src/rapidata/api_client/models/query_jobs_result.py +++ b/src/rapidata/api_client/models/query_jobs_result.py @@ -32,9 +32,10 @@ class QueryJobsResult(BaseModel): definition_id: StrictStr = Field(alias="definitionId") audience_id: StrictStr = Field(alias="audienceId") revision_number: StrictInt = Field(alias="revisionNumber") + pipeline_id: StrictStr = Field(alias="pipelineId") status: StrictStr created_at: datetime = Field(alias="createdAt") - __properties: ClassVar[List[str]] = ["jobId", "name", "definitionId", "audienceId", "revisionNumber", "status", "createdAt"] + __properties: ClassVar[List[str]] = ["jobId", "name", "definitionId", "audienceId", "revisionNumber", "pipelineId", "status", "createdAt"] model_config = ConfigDict( populate_by_name=True, @@ -92,6 +93,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "definitionId": obj.get("definitionId"), "audienceId": obj.get("audienceId"), "revisionNumber": obj.get("revisionNumber"), + "pipelineId": obj.get("pipelineId"), "status": obj.get("status"), "createdAt": obj.get("createdAt") }) diff --git a/src/rapidata/api_client/models/update_validation_rapid_model.py b/src/rapidata/api_client/models/update_validation_rapid_model.py index 153c70bc..9f3b66ba 100644 --- a/src/rapidata/api_client/models/update_validation_rapid_model.py +++ b/src/rapidata/api_client/models/update_validation_rapid_model.py @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union from rapidata.api_client.models.i_asset_input import IAssetInput -from rapidata.api_client.models.i_validation_truth import IValidationTruth +from rapidata.api_client.models.i_validation_truth_model import IValidationTruthModel from typing import Optional, Set from typing_extensions import Self @@ -28,7 +28,7 @@ class UpdateValidationRapidModel(BaseModel): """ UpdateValidationRapidModel """ # noqa: E501 - truth: Optional[IValidationTruth] = None + truth: Optional[IValidationTruthModel] = None explanation: Optional[StrictStr] = None context: Optional[StrictStr] = None context_asset: Optional[IAssetInput] = Field(default=None, alias="contextAsset") @@ -117,7 +117,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "truth": IValidationTruth.from_dict(obj["truth"]) if obj.get("truth") is not None else None, + "truth": IValidationTruthModel.from_dict(obj["truth"]) if obj.get("truth") is not None else None, "explanation": obj.get("explanation"), "context": obj.get("context"), "contextAsset": IAssetInput.from_dict(obj["contextAsset"]) if obj.get("contextAsset") is not None else None, diff --git a/src/rapidata/api_client_README.md b/src/rapidata/api_client_README.md index c24b2bcb..1378f9cb 100644 --- a/src/rapidata/api_client_README.md +++ b/src/rapidata/api_client_README.md @@ -146,6 +146,7 @@ Class | Method | HTTP request | Description *JobApi* | [**job_definition_definition_id_revisions_get**](rapidata/api_client/docs/JobApi.md#job_definition_definition_id_revisions_get) | **GET** /job/definition/{definitionId}/revisions | Queries job revisions for a specific definition based on filter, page, and sort criteria. *JobApi* | [**job_definition_post**](rapidata/api_client/docs/JobApi.md#job_definition_post) | **POST** /job/definition | Creates a new job definition. *JobApi* | [**job_definitions_get**](rapidata/api_client/docs/JobApi.md#job_definitions_get) | **GET** /job/definitions | Queries job definitions based on filter, page, and sort criteria. +*JobApi* | [**job_job_id_get**](rapidata/api_client/docs/JobApi.md#job_job_id_get) | **GET** /job/{jobId} | Gets a job by its id. *JobApi* | [**job_post**](rapidata/api_client/docs/JobApi.md#job_post) | **POST** /job | Creates a new job from a job definition and audience. *JobApi* | [**jobs_get**](rapidata/api_client/docs/JobApi.md#jobs_get) | **GET** /jobs | Queries jobs based on filter, page, and sort criteria. *LeaderboardApi* | [**benchmark_standing_leaderboard_id_participant_id_get**](rapidata/api_client/docs/LeaderboardApi.md#benchmark_standing_leaderboard_id_participant_id_get) | **GET** /benchmark/standing/{leaderboardId}/{participantId} | Gets a standing by leaderboardId and participantId. @@ -310,6 +311,7 @@ Class | Method | HTTP request | Description - [GetFileMetadataResult](rapidata/api_client/docs/GetFileMetadataResult.md) - [GetGroupedRankingWorkflowResultsModel](rapidata/api_client/docs/GetGroupedRankingWorkflowResultsModel.md) - [GetGroupedRankingWorkflowResultsResult](rapidata/api_client/docs/GetGroupedRankingWorkflowResultsResult.md) + - [GetJobByIdEndpointOutput](rapidata/api_client/docs/GetJobByIdEndpointOutput.md) - [GetJobDefinitionByIdEndpointOutput](rapidata/api_client/docs/GetJobDefinitionByIdEndpointOutput.md) - [GetJobRevisionEndpointOutput](rapidata/api_client/docs/GetJobRevisionEndpointOutput.md) - [GetLeaderboardByIdResult](rapidata/api_client/docs/GetLeaderboardByIdResult.md) @@ -372,7 +374,6 @@ Class | Method | HTTP request | Description - [ICampaignFilterResponseCountFilter](rapidata/api_client/docs/ICampaignFilterResponseCountFilter.md) - [ICampaignFilterUserActionRestrictionFilter](rapidata/api_client/docs/ICampaignFilterUserActionRestrictionFilter.md) - [ICampaignFilterUserScoreFilter](rapidata/api_client/docs/ICampaignFilterUserScoreFilter.md) - - [ICampaignFilterUserStateFilter](rapidata/api_client/docs/ICampaignFilterUserStateFilter.md) - [IDatasetMetadataInput](rapidata/api_client/docs/IDatasetMetadataInput.md) - [IDatasetMetadataInputPromptAssetMetadataInput](rapidata/api_client/docs/IDatasetMetadataInputPromptAssetMetadataInput.md) - [IDatasetMetadataInputPromptMetadataInput](rapidata/api_client/docs/IDatasetMetadataInputPromptMetadataInput.md) @@ -382,6 +383,7 @@ Class | Method | HTTP request | Description - [IMetadata](rapidata/api_client/docs/IMetadata.md) - [IMetadataClassificationMetadata](rapidata/api_client/docs/IMetadataClassificationMetadata.md) - [IMetadataCountMetadata](rapidata/api_client/docs/IMetadataCountMetadata.md) + - [IMetadataDurationMetadata](rapidata/api_client/docs/IMetadataDurationMetadata.md) - [IMetadataFileTypeMetadata](rapidata/api_client/docs/IMetadataFileTypeMetadata.md) - [IMetadataImageDimensionMetadata](rapidata/api_client/docs/IMetadataImageDimensionMetadata.md) - [IMetadataInput](rapidata/api_client/docs/IMetadataInput.md) @@ -402,7 +404,6 @@ Class | Method | HTTP request | Description - [IMetadataSourceUrlMetadata](rapidata/api_client/docs/IMetadataSourceUrlMetadata.md) - [IMetadataStreamsMetadata](rapidata/api_client/docs/IMetadataStreamsMetadata.md) - [IMetadataTextMetadata](rapidata/api_client/docs/IMetadataTextMetadata.md) - - [IMetadataVideoDurationMetadata](rapidata/api_client/docs/IMetadataVideoDurationMetadata.md) - [IOrderWorkflowModel](rapidata/api_client/docs/IOrderWorkflowModel.md) - [IOrderWorkflowModelCompareWorkflowModel](rapidata/api_client/docs/IOrderWorkflowModelCompareWorkflowModel.md) - [IOrderWorkflowModelEvaluationWorkflowModel](rapidata/api_client/docs/IOrderWorkflowModelEvaluationWorkflowModel.md) @@ -501,6 +502,20 @@ Class | Method | HTTP request | Description - [IValidationTruthEmptyValidationTruth](rapidata/api_client/docs/IValidationTruthEmptyValidationTruth.md) - [IValidationTruthLineTruth](rapidata/api_client/docs/IValidationTruthLineTruth.md) - [IValidationTruthLocateBoxTruth](rapidata/api_client/docs/IValidationTruthLocateBoxTruth.md) + - [IValidationTruthModel](rapidata/api_client/docs/IValidationTruthModel.md) + - [IValidationTruthModelAttachCategoryTruthModel](rapidata/api_client/docs/IValidationTruthModelAttachCategoryTruthModel.md) + - [IValidationTruthModelBoundingBoxTruthModel](rapidata/api_client/docs/IValidationTruthModelBoundingBoxTruthModel.md) + - [IValidationTruthModelClassifyTruthModel](rapidata/api_client/docs/IValidationTruthModelClassifyTruthModel.md) + - [IValidationTruthModelCompareTruthModel](rapidata/api_client/docs/IValidationTruthModelCompareTruthModel.md) + - [IValidationTruthModelEmptyValidationTruthModel](rapidata/api_client/docs/IValidationTruthModelEmptyValidationTruthModel.md) + - [IValidationTruthModelLineTruthModel](rapidata/api_client/docs/IValidationTruthModelLineTruthModel.md) + - [IValidationTruthModelLocateBoxTruthModel](rapidata/api_client/docs/IValidationTruthModelLocateBoxTruthModel.md) + - [IValidationTruthModelMultiCompareTruthModel](rapidata/api_client/docs/IValidationTruthModelMultiCompareTruthModel.md) + - [IValidationTruthModelNamedEntityTruthModel](rapidata/api_client/docs/IValidationTruthModelNamedEntityTruthModel.md) + - [IValidationTruthModelPolygonTruthModel](rapidata/api_client/docs/IValidationTruthModelPolygonTruthModel.md) + - [IValidationTruthModelScrubTruthModel](rapidata/api_client/docs/IValidationTruthModelScrubTruthModel.md) + - [IValidationTruthModelSkipTruthModel](rapidata/api_client/docs/IValidationTruthModelSkipTruthModel.md) + - [IValidationTruthModelTranscriptionTruthModel](rapidata/api_client/docs/IValidationTruthModelTranscriptionTruthModel.md) - [IValidationTruthMultiCompareTruth](rapidata/api_client/docs/IValidationTruthMultiCompareTruth.md) - [IValidationTruthNamedEntityTruth](rapidata/api_client/docs/IValidationTruthNamedEntityTruth.md) - [IValidationTruthPolygonTruth](rapidata/api_client/docs/IValidationTruthPolygonTruth.md) diff --git a/src/rapidata/rapidata_client/audience/audience_example_handler.py b/src/rapidata/rapidata_client/audience/audience_example_handler.py index 2dedea9c..0d53721a 100644 --- a/src/rapidata/rapidata_client/audience/audience_example_handler.py +++ b/src/rapidata/rapidata_client/audience/audience_example_handler.py @@ -157,6 +157,7 @@ def add_compare_example( else None ), explanation=explanation, + randomCorrectProbability=0.5, ), )