1 package prediction 2 3 // Copyright (c) Microsoft Corporation. All rights reserved. 4 // Licensed under the MIT License. See License.txt in the project root for license information. 5 // 6 // Code generated by Microsoft (R) AutoRest Code Generator. 7 // Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9 import ( 10 "encoding/json" 11 "github.com/Azure/go-autorest/autorest" 12 "github.com/Azure/go-autorest/autorest/date" 13 "github.com/gofrs/uuid" 14 ) 15 16 // The package's fully qualified name. 17 const fqdn = "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.0/customvision/prediction" 18 19 // BoundingBox bounding box that defines a region of an image. 20 type BoundingBox struct { 21 // Left - Coordinate of the left boundary. 22 Left *float64 `json:"left,omitempty"` 23 // Top - Coordinate of the top boundary. 24 Top *float64 `json:"top,omitempty"` 25 // Width - Width. 26 Width *float64 `json:"width,omitempty"` 27 // Height - Height. 28 Height *float64 `json:"height,omitempty"` 29 } 30 31 // CustomVisionError ... 32 type CustomVisionError struct { 33 // Code - The error code. Possible values include: 'NoError', 'BadRequest', 'BadRequestExceededBatchSize', 'BadRequestNotSupported', 'BadRequestInvalidIds', 'BadRequestProjectName', 'BadRequestProjectNameNotUnique', 'BadRequestProjectDescription', 'BadRequestProjectUnknownDomain', 'BadRequestProjectUnknownClassification', 'BadRequestProjectUnsupportedDomainTypeChange', 'BadRequestProjectUnsupportedExportPlatform', 'BadRequestIterationName', 'BadRequestIterationNameNotUnique', 'BadRequestIterationDescription', 'BadRequestIterationIsNotTrained', 'BadRequestWorkspaceCannotBeModified', 'BadRequestWorkspaceNotDeletable', 'BadRequestTagName', 'BadRequestTagNameNotUnique', 'BadRequestTagDescription', 'BadRequestTagType', 'BadRequestMultipleNegativeTag', 'BadRequestImageTags', 'BadRequestImageRegions', 'BadRequestNegativeAndRegularTagOnSameImage', 'BadRequestRequiredParamIsNull', 'BadRequestIterationIsPublished', 'BadRequestInvalidPublishName', 'BadRequestInvalidPublishTarget', 'BadRequestUnpublishFailed', 'BadRequestSubscriptionAPI', 'BadRequestExceedProjectLimit', 'BadRequestExceedIterationPerProjectLimit', 'BadRequestExceedTagPerProjectLimit', 'BadRequestExceedTagPerImageLimit', 'BadRequestExceededQuota', 'BadRequestCannotMigrateProjectWithName', 'BadRequestNotLimitedTrial', 'BadRequestImageBatch', 'BadRequestImageStream', 'BadRequestImageURL', 'BadRequestImageFormat', 'BadRequestImageSizeBytes', 'BadRequestImageExceededCount', 'BadRequestTrainingNotNeeded', 'BadRequestTrainingNotNeededButTrainingPipelineUpdated', 'BadRequestTrainingValidationFailed', 'BadRequestClassificationTrainingValidationFailed', 'BadRequestMultiClassClassificationTrainingValidationFailed', 'BadRequestMultiLabelClassificationTrainingValidationFailed', 'BadRequestDetectionTrainingValidationFailed', 'BadRequestTrainingAlreadyInProgress', 'BadRequestDetectionTrainingNotAllowNegativeTag', 'BadRequestInvalidEmailAddress', 'BadRequestDomainNotSupportedForAdvancedTraining', 'BadRequestExportPlatformNotSupportedForAdvancedTraining', 'BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining', 'BadRequestExportValidationFailed', 'BadRequestExportAlreadyInProgress', 'BadRequestPredictionIdsMissing', 'BadRequestPredictionIdsExceededCount', 'BadRequestPredictionTagsExceededCount', 'BadRequestPredictionResultsExceededCount', 'BadRequestPredictionInvalidApplicationName', 'BadRequestPredictionInvalidQueryParameters', 'BadRequestInvalid', 'UnsupportedMediaType', 'Forbidden', 'ForbiddenUser', 'ForbiddenUserResource', 'ForbiddenUserSignupDisabled', 'ForbiddenUserSignupAllowanceExceeded', 'ForbiddenUserDoesNotExist', 'ForbiddenUserDisabled', 'ForbiddenUserInsufficientCapability', 'ForbiddenDRModeEnabled', 'ForbiddenInvalid', 'NotFound', 'NotFoundProject', 'NotFoundProjectDefaultIteration', 'NotFoundIteration', 'NotFoundIterationPerformance', 'NotFoundTag', 'NotFoundImage', 'NotFoundDomain', 'NotFoundApimSubscription', 'NotFoundInvalid', 'Conflict', 'ConflictInvalid', 'ErrorUnknown', 'ErrorProjectInvalidWorkspace', 'ErrorProjectInvalidPipelineConfiguration', 'ErrorProjectInvalidDomain', 'ErrorProjectTrainingRequestFailed', 'ErrorProjectExportRequestFailed', 'ErrorFeaturizationServiceUnavailable', 'ErrorFeaturizationQueueTimeout', 'ErrorFeaturizationInvalidFeaturizer', 'ErrorFeaturizationAugmentationUnavailable', 'ErrorFeaturizationUnrecognizedJob', 'ErrorFeaturizationAugmentationError', 'ErrorExporterInvalidPlatform', 'ErrorExporterInvalidFeaturizer', 'ErrorExporterInvalidClassifier', 'ErrorPredictionServiceUnavailable', 'ErrorPredictionModelNotFound', 'ErrorPredictionModelNotCached', 'ErrorPrediction', 'ErrorPredictionStorage', 'ErrorRegionProposal', 'ErrorInvalid' 34 Code CustomVisionErrorCodes `json:"code,omitempty"` 35 // Message - A message explaining the error reported by the service. 36 Message *string `json:"message,omitempty"` 37 } 38 39 // ImagePrediction result of an image prediction request. 40 type ImagePrediction struct { 41 autorest.Response `json:"-"` 42 // ID - READ-ONLY; Prediction Id. 43 ID *uuid.UUID `json:"id,omitempty"` 44 // Project - READ-ONLY; Project Id. 45 Project *uuid.UUID `json:"project,omitempty"` 46 // Iteration - READ-ONLY; Iteration Id. 47 Iteration *uuid.UUID `json:"iteration,omitempty"` 48 // Created - READ-ONLY; Date this prediction was created. 49 Created *date.Time `json:"created,omitempty"` 50 // Predictions - READ-ONLY; List of predictions. 51 Predictions *[]Model `json:"predictions,omitempty"` 52 } 53 54 // MarshalJSON is the custom marshaler for ImagePrediction. 55 func (IP ImagePrediction) MarshalJSON() ([]byte, error) { 56 objectMap := make(map[string]interface{}) 57 return json.Marshal(objectMap) 58 } 59 60 // ImageURL image url. 61 type ImageURL struct { 62 // URL - Url of the image. 63 URL *string `json:"url,omitempty"` 64 } 65 66 // Model prediction result. 67 type Model struct { 68 // Probability - READ-ONLY; Probability of the tag. 69 Probability *float64 `json:"probability,omitempty"` 70 // TagID - READ-ONLY; Id of the predicted tag. 71 TagID *uuid.UUID `json:"tagId,omitempty"` 72 // TagName - READ-ONLY; Name of the predicted tag. 73 TagName *string `json:"tagName,omitempty"` 74 // BoundingBox - READ-ONLY; Bounding box of the prediction. 75 BoundingBox *BoundingBox `json:"boundingBox,omitempty"` 76 } 77 78 // MarshalJSON is the custom marshaler for Model. 79 func (mVar Model) MarshalJSON() ([]byte, error) { 80 objectMap := make(map[string]interface{}) 81 return json.Marshal(objectMap) 82 } 83