├── .appsody-config.yaml ├── .bumpversion.cfg ├── .github ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── issue_template.md ├── pull_request_template.md ├── stale.yml └── workflows │ ├── build-test.yml │ ├── deploy.yml │ └── integration-test.yml ├── .gitignore ├── .releaserc ├── .secrets.baseline ├── .swiftformat ├── .swiftlint.yml ├── .travis.yml ├── CHANGELOG.md ├── Cartfile ├── Cartfile.resolved ├── Dockerfile ├── IBMWatsonAssistantV1.podspec ├── IBMWatsonAssistantV2.podspec ├── IBMWatsonDiscoveryV1.podspec ├── IBMWatsonDiscoveryV2.podspec ├── IBMWatsonLanguageTranslatorV3.podspec ├── IBMWatsonNaturalLanguageUnderstandingV1.podspec ├── IBMWatsonSpeechToTextV1.podspec ├── IBMWatsonTextToSpeechV1.podspec ├── LICENSE ├── MIGRATION-V4.md ├── Package.resolved ├── Package.swift ├── README.md ├── Scripts ├── build-libogg.sh ├── build-libopus.sh ├── coverage.sh ├── deploy-to-cocoapods-gha.sh ├── generate-binaries.sh ├── generate-documentation-resources │ ├── css │ │ ├── highlight.css │ │ └── jazzy.css │ ├── img │ │ ├── carat.png │ │ ├── dash.png │ │ └── gh.png │ ├── index-postfix │ ├── index-prefix │ └── js │ │ ├── jazzy.js │ │ └── jquery.min.js ├── generate-documentation.sh ├── jazzy-config │ ├── AssistantV1.jazzy.yaml │ ├── AssistantV2.jazzy.yaml │ ├── DiscoveryV1.jazzy.yaml │ ├── DiscoveryV2.jazzy.yaml │ ├── LanguageTranslatorV3.jazzy.yaml │ ├── NaturalLanguageUnderstandingV1.jazzy.yaml │ ├── SpeechToTextV1.jazzy.yaml │ └── TextToSpeechV1.jazzy.yaml ├── pod-lint.sh ├── publish-documentation-gha.sh ├── run-tests.sh ├── travis │ ├── deploy-to-cocoapods.sh │ ├── new-release.sh │ ├── publish-documentation.sh │ ├── test-Linux.sh │ └── test-macOS.sh └── upload-coverage.sh ├── Sources ├── AssistantV1 │ ├── Assistant.swift │ ├── InsecureConnection.swift │ ├── Models │ │ ├── AgentAvailabilityMessage.swift │ │ ├── BulkClassifyOutput.swift │ │ ├── BulkClassifyResponse.swift │ │ ├── BulkClassifyUtterance.swift │ │ ├── CaptureGroup.swift │ │ ├── ChannelTransferInfo.swift │ │ ├── ChannelTransferTarget.swift │ │ ├── ChannelTransferTargetChat.swift │ │ ├── Context.swift │ │ ├── Counterexample.swift │ │ ├── CounterexampleCollection.swift │ │ ├── CreateEntity.swift │ │ ├── CreateIntent.swift │ │ ├── CreateValue.swift │ │ ├── DialogNode.swift │ │ ├── DialogNodeAction.swift │ │ ├── DialogNodeCollection.swift │ │ ├── DialogNodeContext.swift │ │ ├── DialogNodeNextStep.swift │ │ ├── DialogNodeOutput.swift │ │ ├── DialogNodeOutputConnectToAgentTransferInfo.swift │ │ ├── DialogNodeOutputGeneric.swift │ │ ├── DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.swift │ │ ├── DialogNodeOutputGenericDialogNodeOutputResponseTypeChannelTransfer.swift │ │ ├── DialogNodeOutputGenericDialogNodeOutputResponseTypeConnectToAgent.swift │ │ ├── DialogNodeOutputGenericDialogNodeOutputResponseTypeIframe.swift │ │ ├── DialogNodeOutputGenericDialogNodeOutputResponseTypeImage.swift │ │ ├── DialogNodeOutputGenericDialogNodeOutputResponseTypeOption.swift │ │ ├── DialogNodeOutputGenericDialogNodeOutputResponseTypePause.swift │ │ ├── DialogNodeOutputGenericDialogNodeOutputResponseTypeSearchSkill.swift │ │ ├── DialogNodeOutputGenericDialogNodeOutputResponseTypeText.swift │ │ ├── DialogNodeOutputGenericDialogNodeOutputResponseTypeUserDefined.swift │ │ ├── DialogNodeOutputGenericDialogNodeOutputResponseTypeVideo.swift │ │ ├── DialogNodeOutputModifiers.swift │ │ ├── DialogNodeOutputOptionsElement.swift │ │ ├── DialogNodeOutputOptionsElementValue.swift │ │ ├── DialogNodeOutputTextValuesElement.swift │ │ ├── DialogNodeVisitedDetails.swift │ │ ├── DialogSuggestion.swift │ │ ├── DialogSuggestionValue.swift │ │ ├── Entity.swift │ │ ├── EntityCollection.swift │ │ ├── EntityMention.swift │ │ ├── EntityMentionCollection.swift │ │ ├── Example.swift │ │ ├── ExampleCollection.swift │ │ ├── Intent.swift │ │ ├── IntentCollection.swift │ │ ├── Log.swift │ │ ├── LogCollection.swift │ │ ├── LogMessage.swift │ │ ├── LogMessageSource.swift │ │ ├── LogPagination.swift │ │ ├── Mention.swift │ │ ├── MessageContextMetadata.swift │ │ ├── MessageInput.swift │ │ ├── MessageRequest.swift │ │ ├── MessageResponse.swift │ │ ├── OutputData.swift │ │ ├── Pagination.swift │ │ ├── ResponseGenericChannel.swift │ │ ├── RuntimeEntity.swift │ │ ├── RuntimeEntityAlternative.swift │ │ ├── RuntimeEntityInterpretation.swift │ │ ├── RuntimeEntityRole.swift │ │ ├── RuntimeIntent.swift │ │ ├── RuntimeResponseGeneric.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeAudio.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeChannelTransfer.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeConnectToAgent.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeIframe.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeImage.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeOption.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypePause.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeSuggestion.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeText.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeUserDefined.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeVideo.swift │ │ ├── Synonym.swift │ │ ├── SynonymCollection.swift │ │ ├── Value.swift │ │ ├── ValueCollection.swift │ │ ├── Webhook.swift │ │ ├── WebhookHeader.swift │ │ ├── Workspace.swift │ │ ├── WorkspaceCollection.swift │ │ ├── WorkspaceSystemSettings.swift │ │ ├── WorkspaceSystemSettingsDisambiguation.swift │ │ ├── WorkspaceSystemSettingsOffTopic.swift │ │ ├── WorkspaceSystemSettingsSystemEntities.swift │ │ └── WorkspaceSystemSettingsTooling.swift │ ├── README.md │ └── Shared.swift ├── AssistantV2 │ ├── Assistant.swift │ ├── InsecureConnection.swift │ ├── Models │ │ ├── AgentAvailabilityMessage.swift │ │ ├── BulkClassifyOutput.swift │ │ ├── BulkClassifyResponse.swift │ │ ├── BulkClassifyUtterance.swift │ │ ├── CaptureGroup.swift │ │ ├── ChannelTransferInfo.swift │ │ ├── ChannelTransferTarget.swift │ │ ├── ChannelTransferTargetChat.swift │ │ ├── DialogLogMessage.swift │ │ ├── DialogNodeAction.swift │ │ ├── DialogNodeOutputConnectToAgentTransferInfo.swift │ │ ├── DialogNodeOutputOptionsElement.swift │ │ ├── DialogNodeOutputOptionsElementValue.swift │ │ ├── DialogNodeVisited.swift │ │ ├── DialogSuggestion.swift │ │ ├── DialogSuggestionValue.swift │ │ ├── Log.swift │ │ ├── LogCollection.swift │ │ ├── LogMessageSource.swift │ │ ├── LogMessageSourceAction.swift │ │ ├── LogMessageSourceDialogNode.swift │ │ ├── LogMessageSourceHandler.swift │ │ ├── LogMessageSourceStep.swift │ │ ├── LogPagination.swift │ │ ├── MessageContext.swift │ │ ├── MessageContextGlobal.swift │ │ ├── MessageContextGlobalStateless.swift │ │ ├── MessageContextGlobalSystem.swift │ │ ├── MessageContextSkill.swift │ │ ├── MessageContextSkillSystem.swift │ │ ├── MessageContextStateless.swift │ │ ├── MessageInput.swift │ │ ├── MessageInputAttachment.swift │ │ ├── MessageInputOptions.swift │ │ ├── MessageInputOptionsSpelling.swift │ │ ├── MessageInputOptionsStateless.swift │ │ ├── MessageInputStateless.swift │ │ ├── MessageOutput.swift │ │ ├── MessageOutputDebug.swift │ │ ├── MessageOutputSpelling.swift │ │ ├── MessageRequest.swift │ │ ├── MessageResponse.swift │ │ ├── MessageResponseStateless.swift │ │ ├── ResponseGenericChannel.swift │ │ ├── RuntimeEntity.swift │ │ ├── RuntimeEntityAlternative.swift │ │ ├── RuntimeEntityInterpretation.swift │ │ ├── RuntimeEntityRole.swift │ │ ├── RuntimeIntent.swift │ │ ├── RuntimeResponseGeneric.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeAudio.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeChannelTransfer.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeConnectToAgent.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeIframe.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeImage.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeOption.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypePause.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeSearch.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeSuggestion.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeText.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeUserDefined.swift │ │ ├── RuntimeResponseGenericRuntimeResponseTypeVideo.swift │ │ ├── SearchResult.swift │ │ ├── SearchResultAnswer.swift │ │ ├── SearchResultHighlight.swift │ │ ├── SearchResultMetadata.swift │ │ └── SessionResponse.swift │ ├── README.md │ └── Shared.swift ├── DiscoveryV1 │ ├── Discovery.swift │ ├── InsecureConnection.swift │ ├── Models │ │ ├── AggregationResult.swift │ │ ├── Collection.swift │ │ ├── CollectionCrawlStatus.swift │ │ ├── CollectionDiskUsage.swift │ │ ├── CollectionUsage.swift │ │ ├── Completions.swift │ │ ├── Configuration.swift │ │ ├── Conversions.swift │ │ ├── CreateEventResponse.swift │ │ ├── CredentialDetails.swift │ │ ├── Credentials.swift │ │ ├── CredentialsList.swift │ │ ├── DeleteCollectionResponse.swift │ │ ├── DeleteConfigurationResponse.swift │ │ ├── DeleteCredentials.swift │ │ ├── DeleteDocumentResponse.swift │ │ ├── DeleteEnvironmentResponse.swift │ │ ├── DiskUsage.swift │ │ ├── DocumentAccepted.swift │ │ ├── DocumentCounts.swift │ │ ├── DocumentStatus.swift │ │ ├── Enrichment.swift │ │ ├── EnrichmentOptions.swift │ │ ├── Environment.swift │ │ ├── EnvironmentDocuments.swift │ │ ├── EventData.swift │ │ ├── Expansion.swift │ │ ├── Expansions.swift │ │ ├── Field.swift │ │ ├── FontSetting.swift │ │ ├── Gateway.swift │ │ ├── GatewayDelete.swift │ │ ├── GatewayList.swift │ │ ├── HTMLSettings.swift │ │ ├── IndexCapacity.swift │ │ ├── ListCollectionFieldsResponse.swift │ │ ├── ListCollectionsResponse.swift │ │ ├── ListConfigurationsResponse.swift │ │ ├── ListEnvironmentsResponse.swift │ │ ├── LogQueryResponse.swift │ │ ├── LogQueryResponseResult.swift │ │ ├── LogQueryResponseResultDocuments.swift │ │ ├── LogQueryResponseResultDocumentsResult.swift │ │ ├── MetricAggregation.swift │ │ ├── MetricAggregationResult.swift │ │ ├── MetricResponse.swift │ │ ├── MetricTokenAggregation.swift │ │ ├── MetricTokenAggregationResult.swift │ │ ├── MetricTokenResponse.swift │ │ ├── NluEnrichmentConcepts.swift │ │ ├── NluEnrichmentEmotion.swift │ │ ├── NluEnrichmentEntities.swift │ │ ├── NluEnrichmentFeatures.swift │ │ ├── NluEnrichmentKeywords.swift │ │ ├── NluEnrichmentRelations.swift │ │ ├── NluEnrichmentSemanticRoles.swift │ │ ├── NluEnrichmentSentiment.swift │ │ ├── NormalizationOperation.swift │ │ ├── Notice.swift │ │ ├── PDFHeadingDetection.swift │ │ ├── PDFSettings.swift │ │ ├── QueryAggregation.swift │ │ ├── QueryCalculationAggregation.swift │ │ ├── QueryFilterAggregation.swift │ │ ├── QueryHistogramAggregation.swift │ │ ├── QueryHistogramAggregationResult.swift │ │ ├── QueryNestedAggregation.swift │ │ ├── QueryNoticesResponse.swift │ │ ├── QueryNoticesResult.swift │ │ ├── QueryPassages.swift │ │ ├── QueryResponse.swift │ │ ├── QueryResult.swift │ │ ├── QueryResultMetadata.swift │ │ ├── QueryTermAggregation.swift │ │ ├── QueryTermAggregationResult.swift │ │ ├── QueryTimesliceAggregation.swift │ │ ├── QueryTimesliceAggregationResult.swift │ │ ├── QueryTopHitsAggregation.swift │ │ ├── QueryTopHitsAggregationResult.swift │ │ ├── RetrievalDetails.swift │ │ ├── SduStatus.swift │ │ ├── SduStatusCustomFields.swift │ │ ├── SearchStatus.swift │ │ ├── SegmentSettings.swift │ │ ├── Source.swift │ │ ├── SourceOptions.swift │ │ ├── SourceOptionsBuckets.swift │ │ ├── SourceOptionsFolder.swift │ │ ├── SourceOptionsObject.swift │ │ ├── SourceOptionsSiteColl.swift │ │ ├── SourceOptionsWebCrawl.swift │ │ ├── SourceSchedule.swift │ │ ├── SourceStatus.swift │ │ ├── StatusDetails.swift │ │ ├── TokenDictRule.swift │ │ ├── TokenDictStatusResponse.swift │ │ ├── TopHitsResults.swift │ │ ├── TrainingDataSet.swift │ │ ├── TrainingExample.swift │ │ ├── TrainingExampleList.swift │ │ ├── TrainingQuery.swift │ │ ├── TrainingStatus.swift │ │ ├── WordHeadingDetection.swift │ │ ├── WordSettings.swift │ │ ├── WordStyle.swift │ │ └── XPathPatterns.swift │ ├── README.md │ └── Shared.swift ├── DiscoveryV2 │ ├── Discovery.swift │ ├── InsecureConnection.swift │ ├── Models │ │ ├── AnalyzedDocument.swift │ │ ├── AnalyzedResult.swift │ │ ├── ClassifierFederatedModel.swift │ │ ├── ClassifierModelEvaluation.swift │ │ ├── Collection.swift │ │ ├── CollectionDetails.swift │ │ ├── CollectionEnrichment.swift │ │ ├── Completions.swift │ │ ├── ComponentSettingsAggregation.swift │ │ ├── ComponentSettingsFieldsShown.swift │ │ ├── ComponentSettingsFieldsShownBody.swift │ │ ├── ComponentSettingsFieldsShownTitle.swift │ │ ├── ComponentSettingsResponse.swift │ │ ├── CreateDocumentClassifier.swift │ │ ├── CreateEnrichment.swift │ │ ├── DefaultQueryParams.swift │ │ ├── DefaultQueryParamsPassages.swift │ │ ├── DefaultQueryParamsSuggestedRefinements.swift │ │ ├── DefaultQueryParamsTableResults.swift │ │ ├── DeleteDocumentResponse.swift │ │ ├── DocumentAccepted.swift │ │ ├── DocumentAttribute.swift │ │ ├── DocumentClassifier.swift │ │ ├── DocumentClassifierEnrichment.swift │ │ ├── DocumentClassifierModel.swift │ │ ├── DocumentClassifierModels.swift │ │ ├── DocumentClassifiers.swift │ │ ├── Enrichment.swift │ │ ├── EnrichmentOptions.swift │ │ ├── Enrichments.swift │ │ ├── Field.swift │ │ ├── ListCollectionsResponse.swift │ │ ├── ListFieldsResponse.swift │ │ ├── ListProjectsResponse.swift │ │ ├── ModelEvaluationMacroAverage.swift │ │ ├── ModelEvaluationMicroAverage.swift │ │ ├── Notice.swift │ │ ├── PerClassModelEvaluation.swift │ │ ├── ProjectDetails.swift │ │ ├── ProjectListDetails.swift │ │ ├── ProjectListDetailsRelevancyTrainingStatus.swift │ │ ├── QueryAggregation.swift │ │ ├── QueryCalculationAggregation.swift │ │ ├── QueryFilterAggregation.swift │ │ ├── QueryGroupByAggregation.swift │ │ ├── QueryGroupByAggregationResult.swift │ │ ├── QueryHistogramAggregation.swift │ │ ├── QueryHistogramAggregationResult.swift │ │ ├── QueryLargePassages.swift │ │ ├── QueryLargeSuggestedRefinements.swift │ │ ├── QueryLargeTableResults.swift │ │ ├── QueryNestedAggregation.swift │ │ ├── QueryNoticesResponse.swift │ │ ├── QueryResponse.swift │ │ ├── QueryResponsePassage.swift │ │ ├── QueryResult.swift │ │ ├── QueryResultMetadata.swift │ │ ├── QueryResultPassage.swift │ │ ├── QuerySuggestedRefinement.swift │ │ ├── QueryTableResult.swift │ │ ├── QueryTermAggregation.swift │ │ ├── QueryTermAggregationResult.swift │ │ ├── QueryTimesliceAggregation.swift │ │ ├── QueryTimesliceAggregationResult.swift │ │ ├── QueryTopHitsAggregation.swift │ │ ├── QueryTopHitsAggregationResult.swift │ │ ├── ResultPassageAnswer.swift │ │ ├── RetrievalDetails.swift │ │ ├── TableBodyCells.swift │ │ ├── TableCellKey.swift │ │ ├── TableCellValues.swift │ │ ├── TableColumnHeaderIDs.swift │ │ ├── TableColumnHeaderTexts.swift │ │ ├── TableColumnHeaderTextsNormalized.swift │ │ ├── TableColumnHeaders.swift │ │ ├── TableElementLocation.swift │ │ ├── TableHeaders.swift │ │ ├── TableKeyValuePairs.swift │ │ ├── TableResultTable.swift │ │ ├── TableRowHeaderIDs.swift │ │ ├── TableRowHeaderTexts.swift │ │ ├── TableRowHeaderTextsNormalized.swift │ │ ├── TableRowHeaders.swift │ │ ├── TableTextLocation.swift │ │ ├── TrainingExample.swift │ │ ├── TrainingQuery.swift │ │ ├── TrainingQuerySet.swift │ │ └── UpdateDocumentClassifier.swift │ ├── README.md │ └── Shared.swift ├── LanguageTranslatorV3 │ ├── InsecureConnection.swift │ ├── LanguageTranslator.swift │ ├── Models │ │ ├── DeleteModelResult.swift │ │ ├── DocumentList.swift │ │ ├── DocumentStatus.swift │ │ ├── IdentifiableLanguage.swift │ │ ├── IdentifiableLanguages.swift │ │ ├── IdentifiedLanguage.swift │ │ ├── IdentifiedLanguages.swift │ │ ├── Language.swift │ │ ├── Languages.swift │ │ ├── Translation.swift │ │ ├── TranslationModel.swift │ │ ├── TranslationModels.swift │ │ └── TranslationResult.swift │ ├── README.md │ └── Shared.swift ├── NaturalLanguageUnderstandingV1 │ ├── InsecureConnection.swift │ ├── Models │ │ ├── AnalysisResults.swift │ │ ├── AnalysisResultsUsage.swift │ │ ├── Author.swift │ │ ├── CategoriesModel.swift │ │ ├── CategoriesModelList.swift │ │ ├── CategoriesOptions.swift │ │ ├── CategoriesRelevantText.swift │ │ ├── CategoriesResult.swift │ │ ├── CategoriesResultExplanation.swift │ │ ├── ClassificationsModel.swift │ │ ├── ClassificationsModelList.swift │ │ ├── ClassificationsOptions.swift │ │ ├── ClassificationsResult.swift │ │ ├── ConceptsOptions.swift │ │ ├── ConceptsResult.swift │ │ ├── DeleteModelResults.swift │ │ ├── DisambiguationResult.swift │ │ ├── DocumentEmotionResults.swift │ │ ├── DocumentSentimentResults.swift │ │ ├── EmotionOptions.swift │ │ ├── EmotionResult.swift │ │ ├── EmotionScores.swift │ │ ├── EntitiesOptions.swift │ │ ├── EntitiesResult.swift │ │ ├── EntityMention.swift │ │ ├── FeatureSentimentResults.swift │ │ ├── Features.swift │ │ ├── FeaturesResultsMetadata.swift │ │ ├── Feed.swift │ │ ├── KeywordsOptions.swift │ │ ├── KeywordsResult.swift │ │ ├── ListModelsResults.swift │ │ ├── ListSentimentModelsResponse.swift │ │ ├── Model.swift │ │ ├── Notice.swift │ │ ├── RelationArgument.swift │ │ ├── RelationEntity.swift │ │ ├── RelationsOptions.swift │ │ ├── RelationsResult.swift │ │ ├── SemanticRolesEntity.swift │ │ ├── SemanticRolesKeyword.swift │ │ ├── SemanticRolesOptions.swift │ │ ├── SemanticRolesResult.swift │ │ ├── SemanticRolesResultAction.swift │ │ ├── SemanticRolesResultObject.swift │ │ ├── SemanticRolesResultSubject.swift │ │ ├── SemanticRolesVerb.swift │ │ ├── SentenceResult.swift │ │ ├── SentimentModel.swift │ │ ├── SentimentOptions.swift │ │ ├── SentimentResult.swift │ │ ├── SummarizationOptions.swift │ │ ├── SyntaxOptions.swift │ │ ├── SyntaxOptionsTokens.swift │ │ ├── SyntaxResult.swift │ │ ├── TargetedEmotionResults.swift │ │ ├── TargetedSentimentResults.swift │ │ └── TokenResult.swift │ ├── NaturalLanguageUnderstanding.swift │ ├── README.md │ └── Shared.swift ├── SpeechToTextV1 │ ├── InsecureConnection.swift │ ├── Models │ │ ├── AcousticModel.swift │ │ ├── AcousticModels.swift │ │ ├── AudioDetails.swift │ │ ├── AudioListing.swift │ │ ├── AudioMetrics.swift │ │ ├── AudioMetricsDetails.swift │ │ ├── AudioMetricsHistogramBin.swift │ │ ├── AudioResource.swift │ │ ├── AudioResources.swift │ │ ├── Corpora.swift │ │ ├── Corpus.swift │ │ ├── CustomWord.swift │ │ ├── Grammar.swift │ │ ├── Grammars.swift │ │ ├── KeywordResult.swift │ │ ├── LanguageModel.swift │ │ ├── LanguageModels.swift │ │ ├── ProcessedAudio.swift │ │ ├── ProcessingMetrics.swift │ │ ├── RecognitionJob.swift │ │ ├── RecognitionJobs.swift │ │ ├── RegisterStatus.swift │ │ ├── SpeakerLabelsResult.swift │ │ ├── SpeechModel.swift │ │ ├── SpeechModels.swift │ │ ├── SpeechRecognitionAlternative.swift │ │ ├── SpeechRecognitionResult.swift │ │ ├── SpeechRecognitionResults.swift │ │ ├── SupportedFeatures.swift │ │ ├── TrainingResponse.swift │ │ ├── TrainingWarning.swift │ │ ├── Word.swift │ │ ├── WordAlternativeResult.swift │ │ ├── WordAlternativeResults.swift │ │ ├── WordConfidence.swift │ │ ├── WordError.swift │ │ ├── WordTimestamp.swift │ │ └── Words.swift │ ├── README.md │ ├── Shared.swift │ ├── SpeechToText+Recognize.swift │ ├── SpeechToText.swift │ └── WebSockets │ │ ├── RecognitionSettings.swift │ │ ├── RecognitionState.swift │ │ ├── RecognitionStop.swift │ │ ├── RecognizeCallback.swift │ │ ├── SpeechRecognitionResultsAccumulator.swift │ │ ├── SpeechToTextEncoder.swift │ │ ├── SpeechToTextRecorder.swift │ │ ├── SpeechToTextSession.swift │ │ ├── SpeechToTextSocket.swift │ │ └── SpeechToTextState.swift ├── SupportingFiles │ ├── AssistantV1.h │ ├── AssistantV2.h │ ├── Dependencies │ │ ├── Clibogg │ │ │ └── module.modulemap │ │ ├── Clibopus │ │ │ └── module.modulemap │ │ ├── Copustools │ │ │ ├── include │ │ │ │ ├── module.modulemap │ │ │ │ ├── ogg.h │ │ │ │ ├── opus_header.h │ │ │ │ └── os_types.h │ │ │ └── opus_header.c │ │ ├── Libraries │ │ │ ├── libogg.a │ │ │ └── libopus.a │ │ └── Source │ │ │ ├── ogg │ │ │ ├── config_types.h │ │ │ ├── ogg.h │ │ │ └── os_types.h │ │ │ └── opus │ │ │ ├── opus.h │ │ │ ├── opus_defines.h │ │ │ ├── opus_header.c │ │ │ ├── opus_header.h │ │ │ ├── opus_multistream.h │ │ │ └── opus_types.h │ ├── DiscoveryV1.h │ ├── DiscoveryV2.h │ ├── Info-Release.plist │ ├── Info-Tests.plist │ ├── InsecureConnection.swift │ ├── LanguageTranslatorV3.h │ ├── NaturalLanguageUnderstandingV1.h │ ├── Shared.swift │ ├── SharedTests.swift │ ├── SpeechToTextV1.h │ ├── TextToSpeechV1.h │ ├── WatsonCredentials.swift.enc │ ├── WatsonCredentialsExample.swift │ ├── WatsonCredentialsGHA.swift │ └── ibm-credentials-example.env └── TextToSpeechV1 │ ├── InsecureConnection.swift │ ├── Models │ ├── CustomModel.swift │ ├── CustomModels.swift │ ├── Prompt.swift │ ├── PromptMetadata.swift │ ├── Prompts.swift │ ├── Pronunciation.swift │ ├── Speaker.swift │ ├── SpeakerCustomModel.swift │ ├── SpeakerCustomModels.swift │ ├── SpeakerModel.swift │ ├── SpeakerPrompt.swift │ ├── Speakers.swift │ ├── SupportedFeatures.swift │ ├── Translation.swift │ ├── Voice.swift │ ├── Voices.swift │ ├── Word.swift │ └── Words.swift │ ├── README.md │ ├── Shared.swift │ ├── TextToSpeech.swift │ ├── TextToSpeechDecoder.swift │ └── WAVRepair.swift ├── Tests ├── AssistantV1Tests │ ├── AssistantTests.swift │ ├── AssistantV1UnitTests.swift │ ├── TestUtilities.swift │ └── WatsonCredentials.swift ├── AssistantV2Tests │ ├── AssistantV2Tests.swift │ ├── TestUtilities.swift │ └── WatsonCredentials.swift ├── DiscoveryV1Tests │ ├── DiscoveryTest+CPD.swift │ ├── DiscoveryTests.swift │ ├── DiscoveryUnitTests.swift │ ├── Resources │ │ ├── KennedySpeech.html │ │ ├── discoverySample.json │ │ ├── metadata.json │ │ └── stopwords.txt │ ├── TestUtilities.swift │ └── WatsonCredentials.swift ├── DiscoveryV2Tests │ ├── DiscoveryV2CPDTests.swift │ ├── DiscoveryV2Tests.swift │ └── Resources │ │ ├── Jeopardy.html │ │ ├── KennedySpeech.html │ │ ├── TestEnrichments.csv │ │ ├── analyzeDocument.json │ │ └── analyzeDocument.txt ├── LanguageTranslatorV3Tests │ ├── LanguageTranslatorTests.swift │ ├── Resources │ │ ├── common-phrases.pptx │ │ └── glossary.tmx │ ├── TestUtilities.swift │ └── WatsonCredentials.swift ├── LinuxMain.swift ├── NaturalLanguageUnderstandingV1Tests │ ├── NaturalLanguageUnderstandingV1Tests.swift │ ├── Resources │ │ ├── nlu_categories_training.json │ │ ├── nlu_classifications_training.json │ │ └── nlu_training_data.csv │ ├── TestUtilities.swift │ ├── WatsonCredentials.swift │ └── testArticle.html ├── SpeechToTextV1Tests │ ├── Resources │ │ ├── SpeechSample.flac │ │ ├── SpeechSample.ogg │ │ ├── SpeechSample.wav │ │ ├── StockAnnouncement.wav │ │ ├── confirm.abnf │ │ └── healthcare-short.txt │ ├── SpeechToTextRecognizeTests.swift │ ├── SpeechToTextTests.swift │ ├── SpeechToTextUnitTests.swift │ ├── TestUtilities.swift │ └── WatsonCredentials.swift ├── TestUtilities.swift └── TextToSpeechV1Tests │ ├── Resources │ ├── audio.ogg │ └── custom_prompt_audio.wav │ ├── TestUtilities.swift │ ├── TextToSpeechDecoderTests.swift │ ├── TextToSpeechPlaybackTests.swift │ ├── TextToSpeechTests.swift │ └── WatsonCredentials.swift ├── WatsonDeveloperCloud.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── swiftpm │ │ └── Package.resolved └── xcshareddata │ └── xcschemes │ ├── AssistantV1.xcscheme │ ├── AssistantV2.xcscheme │ ├── CompareComplyV1.xcscheme │ ├── DiscoveryV1.xcscheme │ ├── DiscoveryV2.xcscheme │ ├── LanguageTranslatorV3.xcscheme │ ├── NaturalLanguageClassifierV1.xcscheme │ ├── NaturalLanguageUnderstandingV1.xcscheme │ ├── PersonalityInsightsV3.xcscheme │ ├── SpeechToTextV1.xcscheme │ ├── TextToSpeechV1.xcscheme │ ├── ToneAnalyzerV3.xcscheme │ ├── VisualRecognitionV3.xcscheme │ └── VisualRecognitionV4.xcscheme └── docs ├── encrypt-credentials.md ├── images └── png-file-inspector.png └── publishing-release.md /.appsody-config.yaml: -------------------------------------------------------------------------------- 1 | stack: appsody/swift:0.1 2 | -------------------------------------------------------------------------------- /.bumpversion.cfg: -------------------------------------------------------------------------------- 1 | [bumpversion] 2 | current_version = 5.0.0 3 | commit = True 4 | message = Release version {new_version} [skip ci] 5 | 6 | [bumpversion:file:README.md] 7 | 8 | [bumpversion:file:Sources/SupportingFiles/Shared.swift] 9 | 10 | [bumpversion:file:IBMWatsonAssistantV1.podspec] 11 | 12 | [bumpversion:file:IBMWatsonAssistantV2.podspec] 13 | 14 | [bumpversion:file:IBMWatsonDiscoveryV1.podspec] 15 | 16 | [bumpversion:file:IBMWatsonDiscoveryV2.podspec] 17 | 18 | [bumpversion:file:IBMWatsonLanguageTranslatorV3.podspec] 19 | 20 | [bumpversion:file:IBMWatsonNaturalLanguageUnderstandingV1.podspec] 21 | 22 | [bumpversion:file:IBMWatsonSpeechToTextV1.podspec] 23 | 24 | [bumpversion:file:IBMWatsonTextToSpeechV1.podspec] 25 | 26 | [bumpversion:file:Scripts/jazzy-config/AssistantV1.jazzy.yaml] 27 | 28 | [bumpversion:file:Scripts/jazzy-config/AssistantV2.jazzy.yaml] 29 | 30 | [bumpversion:file:Scripts/jazzy-config/DiscoveryV1.jazzy.yaml] 31 | 32 | [bumpversion:file:Scripts/jazzy-config/DiscoveryV2.jazzy.yaml] 33 | 34 | [bumpversion:file:Scripts/jazzy-config/LanguageTranslatorV3.jazzy.yaml] 35 | 36 | [bumpversion:file:Scripts/jazzy-config/NaturalLanguageUnderstandingV1.jazzy.yaml] 37 | 38 | [bumpversion:file:Scripts/jazzy-config/SpeechToTextV1.jazzy.yaml] 39 | 40 | [bumpversion:file:Scripts/jazzy-config/TextToSpeechV1.jazzy.yaml] 41 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | Remember, an issue is not the place to ask questions. If you have issues with the APIs or have a question about the Watson services, see [Stack Overflow](https://stackoverflow.com/questions/tagged/ibm-watson+swift). 11 | 12 | Before you open an issue, please check if a similar issue already exists or has been closed before. 13 | 14 | **Check service status** 15 | 16 | 1. For service issues or 5xx errors, first, go to https://cloud.ibm.com/status?tags=platform,runtimes,services&view=n:i and check the status of the service. 17 | 1. If the service status is OK, continue with a bug report. 18 | 19 | --- 20 | 21 | **Overview** 22 | _What is the issue? Be concise and clear._ 23 | 24 | **Expected behavior** 25 | _What did you expect to happen?_ 26 | 27 | **Actual behavior** 28 | _What actually happened?_ 29 | 30 | **How to reproduce** 31 | _Help us to reproduce what you experienced. Include your code snippets (without credentials)_ 32 | 33 | **Screenshots** 34 | _If applicable, add screenshots to help explain your problem._ 35 | 36 | **SDK Version** 37 | _Please provide the SDK version here._ 38 | 39 | **Additional information:** 40 | - OS: _for example, iOS_ 41 | - Which version of `Swift` are you using? 42 | 43 | **Additional context** 44 | _Add any other details about the problem._ 45 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | Remember, an issue is not the place to ask questions. If you have issues with the APIs or have a question about the Watson services, see [Stack Overflow](https://stackoverflow.com/questions/tagged/ibm-watson+swift). 11 | 12 | Before you open an issue, please check if a similar issue already exists or has been closed before. 13 | 14 | ### When you open an issue for a feature request, please add as much detail as possible: 15 | 16 | - [ ] A descriptive title starting with the service name 17 | - [ ] A description of the problem you're trying to solve 18 | - [ ] A suggested solution if possible 19 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | Remember, an issue is not the place to ask questions. If you have issues with the APIs or have a question about the Watson services, see [Stack Overflow](https://stackoverflow.com/questions/tagged/ibm-watson+swift). 2 | 3 | Before you open an issue, please check if a similar issue already exists or has been closed before. 4 | 5 | ### When reporting a bug, please be sure to include the following: 6 | 7 | - [ ] Start the title with the service name in brackets: `[speech-to-text] websockets...` 8 | - [ ] Steps to reproduce 9 | - [ ] Expected behavior 10 | - [ ] Actual behavior 11 | - [ ] Xcode version 12 | - [ ] swift-sdk version 13 | - [ ] iOS or Linux version you are targeting 14 | 15 | 16 | ### When you open an issue for a feature request, please add as much detail as possible: 17 | - [ ] A descriptive title starting with the service name 18 | - [ ] A description of the problem you're trying to solve 19 | - [ ] A suggested solution if possible 20 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### Summary 2 | 3 | Provide a general description of the code changes in your pull 4 | request... were there any bugs you had fixed? If so, mention them. If 5 | these bugs have open GitHub issues, be sure to tag them here as well, 6 | to keep the conversation linked together. 7 | 8 | ### Other Information 9 | 10 | If there's anything else that's important and relevant to your pull 11 | request, mention that information here. 12 | 13 | 14 | Thanks for contributing to the Watson Developer Cloud! -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 60 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - pinned 8 | - security 9 | # Label to use when marking an issue as stale 10 | staleLabel: wontfix 11 | # Comment to post when marking an issue as stale. Set to `false` to disable 12 | markComment: > 13 | This issue has been automatically marked as stale because it has had no 14 | recent activity. It will be closed if no further activity occurs. Thank you 15 | for your contributions. 16 | # Comment to post when closing a stale issue. Set to `false` to disable 17 | closeComment: false 18 | -------------------------------------------------------------------------------- /.github/workflows/build-test.yml: -------------------------------------------------------------------------------- 1 | # This workflow uses actions that are not certified by GitHub. 2 | # They are provided by a third-party and are governed by 3 | # separate terms of service, privacy policy, and support documentation. 4 | # This workflow will do a clean install of swift dependencies, build the source code and run tests across different versions of swift 5 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift 6 | 7 | name: Build and Test 8 | 9 | on: 10 | push: 11 | branches: [ '**' ] 12 | pull_request: 13 | branches: [ master ] 14 | 15 | # Allows you to run this workflow manually from the Actions tab 16 | workflow_dispatch: 17 | 18 | jobs: 19 | build_test: 20 | 21 | name: Build and Test on ${{ matrix.os }} 22 | runs-on: ${{ matrix.os }} 23 | strategy: 24 | matrix: 25 | os: [macos-latest] 26 | 27 | steps: 28 | - uses: actions/checkout@v2 29 | 30 | - uses: maxim-lobanov/setup-xcode@v1 31 | with: 32 | xcode-version: '12.5' 33 | 34 | - name: Display versions 35 | run: | 36 | swift --version 37 | xcodebuild -version 38 | 39 | - name: Validate Pods 40 | run: Scripts/pod-lint.sh 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Custom 2 | Sources/SupportingFiles/Credentials.swift 3 | Sources/SupportingFiles/WatsonCredentials.swift 4 | 5 | # Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | # Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | # Other 21 | .DS_Store 22 | *.moved-aside 23 | *.xcuserstate 24 | .idea 25 | 26 | # Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | # Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | Packages/ 36 | .build/ 37 | 38 | # Carthage 39 | Carthage/ 40 | 41 | # swagger-codegen 42 | .swagger-codegen-ignore 43 | .swagger-codegen/ 44 | .openapi-generator-ignore 45 | .openapi-generator/ 46 | 47 | # ignore detect secrets files 48 | .pre-commit-config.yaml 49 | 50 | # swift package manager 51 | .swiftpm/ 52 | -------------------------------------------------------------------------------- /.releaserc: -------------------------------------------------------------------------------- 1 | { 2 | "branch": "master", 3 | "verifyConditions": [], 4 | "tagFormat": "v${version}", 5 | "prepare": [ 6 | "@semantic-release/git", 7 | { 8 | "path": "@semantic-release/exec", 9 | "cmd": "bumpversion --new-version ${nextRelease.version} --verbose patch" 10 | } 11 | ], 12 | "publish": [ 13 | { 14 | "path": "@semantic-release/github", 15 | "assets": [] 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /.swiftformat: -------------------------------------------------------------------------------- 1 | --rules indent 2 | --ifdef noindent 3 | --indent 4 4 | --swiftversion 5.2 5 | -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | excluded: # paths to ignore during linting (takes precedence over `included`) 2 | - Carthage 3 | - Sources/SupportingFiles/Dependencies 4 | - Sources/*/Shared.swift 5 | 6 | disabled_rules: # rule identifiers to exclude from running 7 | - closure_parameter_position 8 | - opening_brace 9 | - redundant_string_enum_value 10 | - cyclomatic_complexity 11 | - superfluous_disable_command 12 | - function_parameter_count 13 | - identifier_name 14 | - line_length 15 | 16 | opt_in_rules: 17 | - force_unwrapping 18 | 19 | file_length: 20 | warning: 1000 21 | error: 2000 22 | 23 | type_body_length: 24 | warning: 3000 25 | error: 4000 26 | 27 | function_body_length: 28 | warning: 100 29 | error: 200 30 | 31 | line_length: 32 | warning: 200 33 | error: 300 34 | 35 | identifier_name: 36 | min_length: 37 | warning: 0 38 | error: 0 39 | excluded: # excluded via string array 40 | - id 41 | 42 | trailing_comma: 43 | mandatory_comma: true 44 | 45 | trailing_whitespace: 46 | severity: error 47 | 48 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | osx_image: xcode12.3 2 | addons: 3 | homebrew: 4 | packages: 5 | - carthage 6 | jobs: 7 | include: 8 | - stage: Validate Pods 9 | script: "./Scripts/pod-lint.sh" 10 | os: osx 11 | osx_image: xcode12.3 12 | - stage: release new version 13 | script: "./Scripts/travis/new-release.sh" 14 | os: osx 15 | osx_image: xcode12.3 16 | if: branch = master AND type = push AND fork = false 17 | - stage: deploy to cocoapods 18 | script: "./Scripts/travis/deploy-to-cocoapods.sh" 19 | os: osx 20 | osx_image: xcode12.3 21 | if: branch = master AND type = push AND fork = false 22 | - stage: publish documentation 23 | script: "./Scripts/travis/publish-documentation.sh" 24 | os: osx 25 | osx_image: xcode12.3 26 | if: branch = master AND type = push AND fork = false -------------------------------------------------------------------------------- /Cartfile: -------------------------------------------------------------------------------- 1 | github "daltoniam/Starscream" ~> 4.0.0 2 | github "IBM/swift-sdk-core" ~> 1.2.1 3 | -------------------------------------------------------------------------------- /Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "IBM/swift-sdk-core" "1.2.1" 2 | github "daltoniam/Starscream" "4.0.4" 3 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM swiftdocker/swift:4.1 2 | ADD . /swift-sdk 3 | WORKDIR /swift-sdk 4 | RUN rm -rf /swift-sdk/.build/debug && swift package resolve && swift package clean 5 | CMD swift test 6 | -------------------------------------------------------------------------------- /MIGRATION-V4.md: -------------------------------------------------------------------------------- 1 | # Migrating to `swift-sdk`@4.0.0 2 | 3 | _Note: If migrating from a version less than 3.0, also see the [v3 migration guide wiki](https://github.com/watson-developer-cloud/swift-sdk/wiki/v3-Migration-Guide)._ 4 | 5 | ### Breaking Changes by Service 6 | For detailed listings of what specifically has changed in the various service wrappers and models, see the [CHANGELOG](https://github.com/watson-developer-cloud/swift-sdk/blob/master/CHANGELOG.md) 7 | -------------------------------------------------------------------------------- /Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "object": { 3 | "pins": [ 4 | { 5 | "package": "IBMSwiftSDKCore", 6 | "repositoryURL": "https://github.com/IBM/swift-sdk-core", 7 | "state": { 8 | "branch": null, 9 | "revision": "4ec57773271fd73263adae2ca42f630bf1e2096d", 10 | "version": "1.0.0" 11 | } 12 | } 13 | ] 14 | }, 15 | "version": 1 16 | } 17 | -------------------------------------------------------------------------------- /Scripts/deploy-to-cocoapods-gha.sh: -------------------------------------------------------------------------------- 1 | # Publishes the latest version of all services to Cocoapods 2 | 3 | set -e 4 | 5 | # needed to resolve a caching issue 6 | # that can break deployments on `pod trunk push` 7 | rm -rf ~/.cocoapods/repos 8 | 9 | git pull # Needed to get the new version created by semantic-release 10 | 11 | declare -a allPods=( 12 | "IBMWatsonAssistantV1.podspec" 13 | "IBMWatsonAssistantV2.podspec" 14 | "IBMWatsonDiscoveryV1.podspec" 15 | "IBMWatsonDiscoveryV2.podspec" 16 | "IBMWatsonLanguageTranslatorV3.podspec" 17 | "IBMWatsonNaturalLanguageUnderstandingV1.podspec" 18 | "IBMWatsonSpeechToTextV1.podspec" 19 | "IBMWatsonTextToSpeechV1.podspec" 20 | ) 21 | 22 | for podspec in "${allPods[@]}" 23 | do 24 | # This will only publish pods if their version has been updated 25 | pod trunk push $podspec --allow-warnings 26 | done 27 | -------------------------------------------------------------------------------- /Scripts/generate-binaries.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | pushd `dirname $0` > /dev/null 4 | root=`pwd` 5 | popd > /dev/null 6 | cd $root 7 | cd .. 8 | 9 | carthage bootstrap 10 | carthage build --no-skip-current 11 | carthage archive --output IBMWatsonSDK.framework.zip 12 | -------------------------------------------------------------------------------- /Scripts/generate-documentation-resources/img/carat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/watson-developer-cloud/swift-sdk/f85f1649a1354957284def2ebd6beb4f68d8a61b/Scripts/generate-documentation-resources/img/carat.png -------------------------------------------------------------------------------- /Scripts/generate-documentation-resources/img/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/watson-developer-cloud/swift-sdk/f85f1649a1354957284def2ebd6beb4f68d8a61b/Scripts/generate-documentation-resources/img/dash.png -------------------------------------------------------------------------------- /Scripts/generate-documentation-resources/img/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/watson-developer-cloud/swift-sdk/f85f1649a1354957284def2ebd6beb4f68d8a61b/Scripts/generate-documentation-resources/img/gh.png -------------------------------------------------------------------------------- /Scripts/generate-documentation-resources/index-postfix: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Scripts/jazzy-config/AssistantV1.jazzy.yaml: -------------------------------------------------------------------------------- 1 | copyright: Copyright 2020 IBM 2 | author: IBM 3 | github_url: https://github.com/watson-developer-cloud/swift-sdk 4 | clean: true 5 | output: ../../gh-pages/services/AssistantV1 6 | module: AssistantV1 7 | module_version: "5.0.0" 8 | documentation: ../../Sources/AssistantV1/README.md 9 | readme: ../../Sources/AssistantV1/README.md 10 | build_tool_arguments: 11 | - "-project" 12 | - "WatsonDeveloperCloud.xcodeproj" 13 | - "-scheme" 14 | - "AssistantV1" 15 | - "-destination" 16 | - "platform=iOS Simulator,name=iPhone 11" 17 | -------------------------------------------------------------------------------- /Scripts/jazzy-config/AssistantV2.jazzy.yaml: -------------------------------------------------------------------------------- 1 | copyright: Copyright 2020 IBM 2 | author: IBM 3 | github_url: https://github.com/watson-developer-cloud/swift-sdk 4 | clean: true 5 | output: ../../gh-pages/services/AssistantV2 6 | module: AssistantV2 7 | module_version: "5.0.0" 8 | documentation: ../../Sources/AssistantV2/README.md 9 | readme: ../../Sources/AssistantV2/README.md 10 | build_tool_arguments: 11 | - "-project" 12 | - "WatsonDeveloperCloud.xcodeproj" 13 | - "-scheme" 14 | - "AssistantV2" 15 | - "-destination" 16 | - "platform=iOS Simulator,name=iPhone 11" 17 | -------------------------------------------------------------------------------- /Scripts/jazzy-config/DiscoveryV1.jazzy.yaml: -------------------------------------------------------------------------------- 1 | copyright: Copyright 2020 IBM 2 | author: IBM 3 | github_url: https://github.com/watson-developer-cloud/swift-sdk 4 | clean: true 5 | output: ../../gh-pages/services/DiscoveryV1 6 | module: DiscoveryV1 7 | module_version: "5.0.0" 8 | documentation: ../../Sources/DiscoveryV1/README.md 9 | readme: ../../Sources/DiscoveryV1/README.md 10 | build_tool_arguments: 11 | - "-project" 12 | - "WatsonDeveloperCloud.xcodeproj" 13 | - "-scheme" 14 | - "DiscoveryV1" 15 | - "-destination" 16 | - "platform=iOS Simulator,name=iPhone 11" 17 | -------------------------------------------------------------------------------- /Scripts/jazzy-config/DiscoveryV2.jazzy.yaml: -------------------------------------------------------------------------------- 1 | copyright: Copyright 2020 IBM 2 | author: IBM 3 | github_url: https://github.com/watson-developer-cloud/swift-sdk 4 | clean: true 5 | output: ../../gh-pages/services/DiscoveryV2 6 | module: DiscoveryV2 7 | module_version: "5.0.0" 8 | documentation: ../../Sources/DiscoveryV2/README.md 9 | readme: ../../Sources/DiscoveryV2/README.md 10 | build_tool_arguments: 11 | - "-project" 12 | - "WatsonDeveloperCloud.xcodeproj" 13 | - "-scheme" 14 | - "DiscoveryV2" 15 | - "-destination" 16 | - "platform=iOS Simulator,name=iPhone 11" 17 | -------------------------------------------------------------------------------- /Scripts/jazzy-config/LanguageTranslatorV3.jazzy.yaml: -------------------------------------------------------------------------------- 1 | copyright: Copyright 2020 IBM 2 | author: IBM 3 | github_url: https://github.com/watson-developer-cloud/swift-sdk 4 | clean: true 5 | output: ../../gh-pages/services/LanguageTranslatorV3 6 | module: LanguageTranslatorV3 7 | module_version: "5.0.0" 8 | documentation: ../../Sources/LanguageTranslatorV3/README.md 9 | readme: ../../Sources/LanguageTranslatorV3/README.md 10 | build_tool_arguments: 11 | - "-project" 12 | - "WatsonDeveloperCloud.xcodeproj" 13 | - "-scheme" 14 | - "LanguageTranslatorV3" 15 | - "-destination" 16 | - "platform=iOS Simulator,name=iPhone 11" 17 | -------------------------------------------------------------------------------- /Scripts/jazzy-config/NaturalLanguageUnderstandingV1.jazzy.yaml: -------------------------------------------------------------------------------- 1 | copyright: Copyright 2020 IBM 2 | author: IBM 3 | github_url: https://github.com/watson-developer-cloud/swift-sdk 4 | clean: true 5 | output: ../../gh-pages/services/NaturalLanguageUnderstandingV1 6 | module: NaturalLanguageUnderstandingV1 7 | module_version: "5.0.0" 8 | documentation: ../../Sources/NaturalLanguageUnderstandingV1/README.md 9 | readme: ../../Sources/NaturalLanguageUnderstandingV1/README.md 10 | build_tool_arguments: 11 | - "-project" 12 | - "WatsonDeveloperCloud.xcodeproj" 13 | - "-scheme" 14 | - "NaturalLanguageUnderstandingV1" 15 | - "-destination" 16 | - "platform=iOS Simulator,name=iPhone 11" 17 | -------------------------------------------------------------------------------- /Scripts/jazzy-config/SpeechToTextV1.jazzy.yaml: -------------------------------------------------------------------------------- 1 | copyright: Copyright 2020 IBM 2 | author: IBM 3 | github_url: https://github.com/watson-developer-cloud/swift-sdk 4 | clean: true 5 | output: ../../gh-pages/services/SpeechToTextV1 6 | module: SpeechToTextV1 7 | module_version: "5.0.0" 8 | documentation: ../../Sources/SpeechToTextV1/README.md 9 | readme: ../../Sources/SpeechToTextV1/README.md 10 | build_tool_arguments: 11 | - "-project" 12 | - "WatsonDeveloperCloud.xcodeproj" 13 | - "-scheme" 14 | - "SpeechToTextV1" 15 | - "-destination" 16 | - "platform=iOS Simulator,name=iPhone 11" 17 | -------------------------------------------------------------------------------- /Scripts/jazzy-config/TextToSpeechV1.jazzy.yaml: -------------------------------------------------------------------------------- 1 | copyright: Copyright 2020 IBM 2 | author: IBM 3 | github_url: https://github.com/watson-developer-cloud/swift-sdk 4 | clean: true 5 | output: ../../gh-pages/services/TextToSpeechV1 6 | module: TextToSpeechV1 7 | module_version: "5.0.0" 8 | documentation: ../../Sources/TextToSpeechV1/README.md 9 | readme: ../../Sources/TextToSpeechV1/README.md 10 | build_tool_arguments: 11 | - "-project" 12 | - "WatsonDeveloperCloud.xcodeproj" 13 | - "-scheme" 14 | - "TextToSpeechV1" 15 | - "-destination" 16 | - "platform=iOS Simulator,name=iPhone 11" 17 | -------------------------------------------------------------------------------- /Scripts/pod-lint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script runs a linter on every pod in the Swift SDK. 4 | # This must be run to ensure that every pod is ready to be published to Cocoapods. 5 | # The flag --allow-warnings is required for pods that have build warnings (like deprecation notices). 6 | set -e 7 | 8 | pod lib lint IBMWatsonAssistantV1.podspec --allow-warnings 9 | pod lib lint IBMWatsonAssistantV2.podspec --allow-warnings 10 | pod lib lint IBMWatsonDiscoveryV1.podspec --allow-warnings 11 | pod lib lint IBMWatsonDiscoveryV2.podspec --allow-warnings 12 | pod lib lint IBMWatsonLanguageTranslatorV3.podspec --allow-warnings 13 | pod lib lint IBMWatsonNaturalLanguageUnderstandingV1.podspec --allow-warnings 14 | 15 | pod lib lint IBMWatsonSpeechToTextV1.podspec --allow-warnings 16 | # Cleanup from the podspec prepare_command 17 | git checkout Sources/SupportingFiles/Dependencies 18 | rm Sources/SupportingFiles/Dependencies/Libraries/*stt.a 19 | find Sources/SupportingFiles/Dependencies/Source -maxdepth 1 -type f -delete 20 | 21 | pod lib lint IBMWatsonTextToSpeechV1.podspec --allow-warnings 22 | # Cleanup from the podspec prepare_command 23 | git checkout Sources/SupportingFiles/Dependencies 24 | rm Sources/SupportingFiles/Dependencies/Libraries/*tts.a 25 | find Sources/SupportingFiles/Dependencies/Source -maxdepth 1 -type f -delete 26 | -------------------------------------------------------------------------------- /Scripts/publish-documentation-gha.sh: -------------------------------------------------------------------------------- 1 | # Generate API docs and upload them to Github on the gh-pages branch 2 | 3 | set -e 4 | 5 | gem install jazzy 6 | 7 | printf "\n>>>>> Cloning repository's gh-pages branch into directory 'gh-pages'\n" 8 | git config --global user.email "watdevex@us.ibm.com" 9 | git config --global user.name "watdevex" 10 | git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/watson-developer-cloud/swift-sdk.git gh-pages > /dev/null 11 | printf "\n>>>>> Finished cloning...\n" 12 | 13 | latestVersion=$(git describe --abbrev=0 --tags) 14 | 15 | # Delete all the old docs (but not the docs directory -- this is hand written) 16 | printf "\n>>>>> Delete all the old docs\n" 17 | (cd gh-pages && rm -rf css img index.html js services undocumented.json) 18 | 19 | # Generate the API docs 20 | printf "\n>>>>> Generating the docs using jazzy\n" 21 | ./Scripts/generate-documentation.sh gh-pages 22 | 23 | # Commit and push the newly generated API docs 24 | printf "\n>>>>> Committing new javadoc for version: %s\n" ${latestVersion} 25 | 26 | pushd gh-pages 27 | git add -f . 28 | git commit -m "chore: [skip ci] SDK docs for release ${latestVersion}" 29 | git push -f origin gh-pages 30 | popd 31 | -------------------------------------------------------------------------------- /Scripts/travis/deploy-to-cocoapods.sh: -------------------------------------------------------------------------------- 1 | # Publishes the latest version of all services to Cocoapods 2 | 3 | set -e 4 | 5 | # needed to resolve a caching issue 6 | # that can break deployments on `pod trunk push` 7 | rm -rf ~/.cocoapods/repos 8 | 9 | git pull # Needed to get the new version created by semantic-release 10 | 11 | declare -a allPods=( 12 | "IBMWatsonAssistantV1.podspec" 13 | "IBMWatsonAssistantV2.podspec" 14 | "IBMWatsonDiscoveryV1.podspec" 15 | "IBMWatsonDiscoveryV2.podspec" 16 | "IBMWatsonLanguageTranslatorV3.podspec" 17 | "IBMWatsonNaturalLanguageUnderstandingV1.podspec" 18 | "IBMWatsonSpeechToTextV1.podspec" 19 | "IBMWatsonTextToSpeechV1.podspec" 20 | ) 21 | 22 | for podspec in "${allPods[@]}" 23 | do 24 | # This will only publish pods if their version has been updated 25 | pod trunk push $podspec --allow-warnings 26 | done 27 | -------------------------------------------------------------------------------- /Scripts/travis/new-release.sh: -------------------------------------------------------------------------------- 1 | # Uses the semantic-release tool to automatically release a new version to Github 2 | # Includes: 3 | # New git tag 4 | # Github release with release notes and an attached pre-built SDK 5 | # Updated CHANGELOG 6 | # Updated version number in source files 7 | 8 | set -e 9 | 10 | sudo easy_install pip >/dev/null 11 | source ~/.nvm/nvm.sh 12 | nvm install 10 13 | sudo pip install bumpversion >/dev/null 14 | npm install -g semantic-release@15.9.0 --silent 15 | npm install -g @semantic-release/exec --silent 16 | npm install -g @semantic-release/changelog --silent 17 | npm install -g @semantic-release/git --silent 18 | 19 | npx semantic-release --repository-url https://${GH_TOKEN}@github.com/watson-developer-cloud/swift-sdk --debug 20 | -------------------------------------------------------------------------------- /Scripts/travis/publish-documentation.sh: -------------------------------------------------------------------------------- 1 | # Generate API docs and upload them to Github on the gh-pages branch 2 | # IMPORTANT: This is only meant to be called from Travis builds! 3 | 4 | set -e 5 | 6 | if [ "$TRAVIS" = "true" ]; then 7 | gem install jazzy 8 | 9 | # Configure Travis to be able to push to the Github repo 10 | git config --global user.email "travis@travis-ci.org" 11 | git config --global user.name "Travis CI" 12 | git config --replace-all remote.origin.fetch +refs/heads/*:refs/remotes/origin/* 13 | git remote rm origin 14 | git remote add origin https://watson-developer-cloud:${GH_TOKEN}@github.com/watson-developer-cloud/swift-sdk.git 15 | fi 16 | 17 | git fetch 18 | git checkout master 19 | latestVersion=$(git describe --abbrev=0 --tags) 20 | 21 | git clone --quiet --branch=gh-pages https://github.com/watson-developer-cloud/swift-sdk.git gh-pages > /dev/null 22 | 23 | # Delete all the old docs (but not the docs directory -- this is hand written) 24 | (cd gh-pages && git rm -rf css img index.html js services undocumented.json) 25 | 26 | # Generate the API docs 27 | ./Scripts/generate-documentation.sh gh-pages 28 | 29 | # Commit and push the newly generated API docs 30 | pushd gh-pages 31 | git add . 32 | git commit -m "SDK docs for release ${latestVersion}" 33 | git push 34 | popd 35 | -------------------------------------------------------------------------------- /Scripts/travis/test-Linux.sh: -------------------------------------------------------------------------------- 1 | # Run integration tests on Linux 2 | 3 | sudo apt-get -qq update -y 4 | wget https://swift.org/builds/swift-4.2.4-release/ubuntu1604/swift-4.2.4-RELEASE/swift-4.2.4-RELEASE-ubuntu16.04.tar.gz -q 5 | tar xzf swift-4.2.4-RELEASE-ubuntu16.04.tar.gz 6 | export PATH=swift-4.2.4-RELEASE-ubuntu16.04/usr/bin:$PATH 7 | 8 | # Decrypt credentials files 9 | openssl aes-256-cbc -K $encrypted_d84ac0b7eb5c_key -iv $encrypted_d84ac0b7eb5c_iv -in Sources/SupportingFiles/WatsonCredentials.swift.enc -out Sources/SupportingFiles/WatsonCredentials.swift -d 10 | 11 | swift build 12 | # swift test 13 | -------------------------------------------------------------------------------- /Scripts/travis/test-macOS.sh: -------------------------------------------------------------------------------- 1 | # Run pod lint and integration tests on macOS 2 | 3 | set -e 4 | 5 | # Decrypt credentials files 6 | openssl aes-256-cbc -K $encrypted_451e23e8cd1f_key -iv $encrypted_451e23e8cd1f_iv -in Sources/SupportingFiles/WatsonCredentials.swift.enc -out Sources/SupportingFiles/WatsonCredentials.swift -d 7 | 8 | carthage bootstrap --platform iOS 9 | 10 | ./Scripts/pod-lint.sh 11 | ./Scripts/run-tests.sh 12 | -------------------------------------------------------------------------------- /Scripts/upload-coverage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script uploads the consolidated code coverage report for the Swift SDK. 4 | 5 | # Note: to upload a coverage report, set the CODECOV_TOKEN environment variable 6 | # export CODECOV_TOKEN= 7 | 8 | if [ -z "$CODECOV_TOKEN" ]; then 9 | echo "Set the CODECOV_TOKEN environment variable with the codecov.io access token" 10 | exit 1 11 | fi 12 | 13 | BUILD_ROOT=$(xcodebuild -showBuildSettings | grep '\' | awk '{print $3}') 14 | 15 | COVERAGE_DIR=$BUILD_ROOT/../Coverage 16 | 17 | if [ ! -e "$COVERAGE_DIR/Coverage.txt" ]; then 18 | echo "No coverage report found. Execute the run_tests.sh script to create a coverage report" 19 | exit 1 20 | fi 21 | 22 | bash <(curl -s https://codecov.io/bash) -f $COVERAGE_DIR/Coverage.txt 23 | 24 | -------------------------------------------------------------------------------- /Sources/AssistantV1/Models/BulkClassifyResponse.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | BulkClassifyResponse. 21 | */ 22 | public struct BulkClassifyResponse: Codable, Equatable { 23 | 24 | /** 25 | An array of objects that contain classification information for the submitted input utterances. 26 | */ 27 | public var output: [BulkClassifyOutput]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case output = "output" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/AssistantV1/Models/CounterexampleCollection.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | CounterexampleCollection. 21 | */ 22 | public struct CounterexampleCollection: Codable, Equatable { 23 | 24 | /** 25 | An array of objects describing the examples marked as irrelevant input. 26 | */ 27 | public var counterexamples: [Counterexample] 28 | 29 | /** 30 | The pagination data for the returned objects. 31 | */ 32 | public var pagination: Pagination 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case counterexamples = "counterexamples" 37 | case pagination = "pagination" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/AssistantV1/Models/DialogNodeCollection.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | An array of dialog nodes. 21 | */ 22 | public struct DialogNodeCollection: Codable, Equatable { 23 | 24 | /** 25 | An array of objects describing the dialog nodes defined for the workspace. 26 | */ 27 | public var dialogNodes: [DialogNode] 28 | 29 | /** 30 | The pagination data for the returned objects. 31 | */ 32 | public var pagination: Pagination 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case dialogNodes = "dialog_nodes" 37 | case pagination = "pagination" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/AssistantV1/Models/EntityCollection.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | An array of objects describing the entities for the workspace. 21 | */ 22 | public struct EntityCollection: Codable, Equatable { 23 | 24 | /** 25 | An array of objects describing the entities defined for the workspace. 26 | */ 27 | public var entities: [Entity] 28 | 29 | /** 30 | The pagination data for the returned objects. 31 | */ 32 | public var pagination: Pagination 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case entities = "entities" 37 | case pagination = "pagination" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/AssistantV1/Models/EntityMentionCollection.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | EntityMentionCollection. 21 | */ 22 | public struct EntityMentionCollection: Codable, Equatable { 23 | 24 | /** 25 | An array of objects describing the entity mentions defined for an entity. 26 | */ 27 | public var examples: [EntityMention] 28 | 29 | /** 30 | The pagination data for the returned objects. 31 | */ 32 | public var pagination: Pagination 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case examples = "examples" 37 | case pagination = "pagination" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/AssistantV1/Models/ExampleCollection.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | ExampleCollection. 21 | */ 22 | public struct ExampleCollection: Codable, Equatable { 23 | 24 | /** 25 | An array of objects describing the examples defined for the intent. 26 | */ 27 | public var examples: [Example] 28 | 29 | /** 30 | The pagination data for the returned objects. 31 | */ 32 | public var pagination: Pagination 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case examples = "examples" 37 | case pagination = "pagination" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/AssistantV1/Models/IntentCollection.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | IntentCollection. 21 | */ 22 | public struct IntentCollection: Codable, Equatable { 23 | 24 | /** 25 | An array of objects describing the intents defined for the workspace. 26 | */ 27 | public var intents: [Intent] 28 | 29 | /** 30 | The pagination data for the returned objects. 31 | */ 32 | public var pagination: Pagination 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case intents = "intents" 37 | case pagination = "pagination" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/AssistantV1/Models/LogCollection.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | LogCollection. 21 | */ 22 | public struct LogCollection: Codable, Equatable { 23 | 24 | /** 25 | An array of objects describing log events. 26 | */ 27 | public var logs: [Log] 28 | 29 | /** 30 | The pagination data for the returned objects. 31 | */ 32 | public var pagination: LogPagination 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case logs = "logs" 37 | case pagination = "pagination" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/AssistantV1/Models/SynonymCollection.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | SynonymCollection. 21 | */ 22 | public struct SynonymCollection: Codable, Equatable { 23 | 24 | /** 25 | An array of synonyms. 26 | */ 27 | public var synonyms: [Synonym] 28 | 29 | /** 30 | The pagination data for the returned objects. 31 | */ 32 | public var pagination: Pagination 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case synonyms = "synonyms" 37 | case pagination = "pagination" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/AssistantV1/Models/ValueCollection.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2017, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | ValueCollection. 21 | */ 22 | public struct ValueCollection: Codable, Equatable { 23 | 24 | /** 25 | An array of entity values. 26 | */ 27 | public var values: [Value] 28 | 29 | /** 30 | The pagination data for the returned objects. 31 | */ 32 | public var pagination: Pagination 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case values = "values" 37 | case pagination = "pagination" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/AssistantV1/Models/WorkspaceCollection.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | WorkspaceCollection. 21 | */ 22 | public struct WorkspaceCollection: Codable, Equatable { 23 | 24 | /** 25 | An array of objects describing the workspaces associated with the service instance. 26 | */ 27 | public var workspaces: [Workspace] 28 | 29 | /** 30 | The pagination data for the returned objects. 31 | */ 32 | public var pagination: Pagination 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case workspaces = "workspaces" 37 | case pagination = "pagination" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/AssistantV1/Shared.swift: -------------------------------------------------------------------------------- 1 | ../SupportingFiles/Shared.swift -------------------------------------------------------------------------------- /Sources/AssistantV2/Models/AgentAvailabilityMessage.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | AgentAvailabilityMessage. 21 | */ 22 | public struct AgentAvailabilityMessage: Codable, Equatable { 23 | 24 | /** 25 | The text of the message. 26 | */ 27 | public var message: String? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case message = "message" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/AssistantV2/Models/BulkClassifyResponse.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | BulkClassifyResponse. 21 | */ 22 | public struct BulkClassifyResponse: Codable, Equatable { 23 | 24 | /** 25 | An array of objects that contain classification information for the submitted input utterances. 26 | */ 27 | public var output: [BulkClassifyOutput]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case output = "output" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/AssistantV2/Models/ChannelTransferInfo.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2021. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Information used by an integration to transfer the conversation to a different channel. 21 | */ 22 | public struct ChannelTransferInfo: Codable, Equatable { 23 | 24 | /** 25 | An object specifying target channels available for the transfer. Each property of this object represents an 26 | available transfer target. Currently, the only supported property is **chat**, representing the web chat 27 | integration. 28 | */ 29 | public var target: ChannelTransferTarget 30 | 31 | // Map each property name to the key that shall be used for encoding/decoding. 32 | private enum CodingKeys: String, CodingKey { 33 | case target = "target" 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Sources/AssistantV2/Models/ChannelTransferTarget.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2021. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | An object specifying target channels available for the transfer. Each property of this object represents an available 21 | transfer target. Currently, the only supported property is **chat**, representing the web chat integration. 22 | */ 23 | public struct ChannelTransferTarget: Codable, Equatable { 24 | 25 | /** 26 | Information for transferring to the web chat integration. 27 | */ 28 | public var chat: ChannelTransferTargetChat? 29 | 30 | // Map each property name to the key that shall be used for encoding/decoding. 31 | private enum CodingKeys: String, CodingKey { 32 | case chat = "chat" 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Sources/AssistantV2/Models/ChannelTransferTargetChat.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2021. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Information for transferring to the web chat integration. 21 | */ 22 | public struct ChannelTransferTargetChat: Codable, Equatable { 23 | 24 | /** 25 | The URL of the target web chat. 26 | */ 27 | public var url: String? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case url = "url" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/AssistantV2/Models/DialogNodeOutputConnectToAgentTransferInfo.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | import IBMSwiftSDKCore 19 | 20 | /** 21 | Routing or other contextual information to be used by target service desk systems. 22 | */ 23 | public struct DialogNodeOutputConnectToAgentTransferInfo: Codable, Equatable { 24 | 25 | public var target: [String: [String: JSON]]? 26 | 27 | // Map each property name to the key that shall be used for encoding/decoding. 28 | private enum CodingKeys: String, CodingKey { 29 | case target = "target" 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /Sources/AssistantV2/Models/DialogNodeOutputOptionsElement.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | DialogNodeOutputOptionsElement. 21 | */ 22 | public struct DialogNodeOutputOptionsElement: Codable, Equatable { 23 | 24 | /** 25 | The user-facing label for the option. 26 | */ 27 | public var label: String 28 | 29 | /** 30 | An object defining the message input to be sent to the assistant if the user selects the corresponding option. 31 | */ 32 | public var value: DialogNodeOutputOptionsElementValue 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case label = "label" 37 | case value = "value" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/AssistantV2/Models/DialogNodeOutputOptionsElementValue.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | An object defining the message input to be sent to the assistant if the user selects the corresponding option. 21 | */ 22 | public struct DialogNodeOutputOptionsElementValue: Codable, Equatable { 23 | 24 | /** 25 | An input object that includes the input text. 26 | */ 27 | public var input: MessageInput? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case input = "input" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/AssistantV2/Models/DialogSuggestionValue.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | An object defining the message input to be sent to the assistant if the user selects the corresponding disambiguation 21 | option. 22 | */ 23 | public struct DialogSuggestionValue: Codable, Equatable { 24 | 25 | /** 26 | An input object that includes the input text. 27 | */ 28 | public var input: MessageInput? 29 | 30 | // Map each property name to the key that shall be used for encoding/decoding. 31 | private enum CodingKeys: String, CodingKey { 32 | case input = "input" 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Sources/AssistantV2/Models/LogCollection.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | LogCollection. 21 | */ 22 | public struct LogCollection: Codable, Equatable { 23 | 24 | /** 25 | An array of objects describing log events. 26 | */ 27 | public var logs: [Log] 28 | 29 | /** 30 | The pagination data for the returned objects. 31 | */ 32 | public var pagination: LogPagination 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case logs = "logs" 37 | case pagination = "pagination" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/AssistantV2/Models/ResponseGenericChannel.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2021. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | ResponseGenericChannel. 21 | */ 22 | public struct ResponseGenericChannel: Codable, Equatable { 23 | 24 | /** 25 | A channel for which the response is intended. 26 | */ 27 | public var channel: String? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case channel = "channel" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/AssistantV2/Models/SearchResultAnswer.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2021. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | An object specifing a segment of text that was identified as a direct answer to the search query. 21 | */ 22 | public struct SearchResultAnswer: Codable, Equatable { 23 | 24 | /** 25 | The text of the answer. 26 | */ 27 | public var text: String 28 | 29 | /** 30 | The confidence score for the answer, as returned by the Discovery service. 31 | */ 32 | public var confidence: Double 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case text = "text" 37 | case confidence = "confidence" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/AssistantV2/Models/SessionResponse.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | SessionResponse. 21 | */ 22 | public struct SessionResponse: Codable, Equatable { 23 | 24 | /** 25 | The session ID. 26 | */ 27 | public var sessionID: String 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case sessionID = "session_id" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/AssistantV2/Shared.swift: -------------------------------------------------------------------------------- 1 | ../SupportingFiles/Shared.swift -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/CollectionCrawlStatus.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Object containing information about the crawl status of this collection. 21 | */ 22 | public struct CollectionCrawlStatus: Codable, Equatable { 23 | 24 | /** 25 | Object containing source crawl status information. 26 | */ 27 | public var sourceCrawl: SourceStatus? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case sourceCrawl = "source_crawl" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/CollectionDiskUsage.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Summary of the disk usage statistics for this collection. 21 | */ 22 | public struct CollectionDiskUsage: Codable, Equatable { 23 | 24 | /** 25 | Number of bytes used by the collection. 26 | */ 27 | public var usedBytes: Int? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case usedBytes = "used_bytes" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/CollectionUsage.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Summary of the collection usage in the environment. 21 | */ 22 | public struct CollectionUsage: Codable, Equatable { 23 | 24 | /** 25 | Number of active collections in the environment. 26 | */ 27 | public var available: Int? 28 | 29 | /** 30 | Total number of collections allowed in the environment. 31 | */ 32 | public var maximumAllowed: Int? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case available = "available" 37 | case maximumAllowed = "maximum_allowed" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/Completions.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | An object containing an array of autocompletion suggestions. 21 | */ 22 | public struct Completions: Codable, Equatable { 23 | 24 | /** 25 | Array of autcomplete suggestion based on the provided prefix. 26 | */ 27 | public var completions: [String]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case completions = "completions" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/CreateEventResponse.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | An object defining the event being created. 21 | */ 22 | public struct CreateEventResponse: Codable, Equatable { 23 | 24 | /** 25 | The event type that was created. 26 | */ 27 | public enum TypeEnum: String { 28 | case click = "click" 29 | } 30 | 31 | /** 32 | The event type that was created. 33 | */ 34 | public var type: String? 35 | 36 | /** 37 | Query event data object. 38 | */ 39 | public var data: EventData? 40 | 41 | // Map each property name to the key that shall be used for encoding/decoding. 42 | private enum CodingKeys: String, CodingKey { 43 | case type = "type" 44 | case data = "data" 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/CredentialsList.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Object containing array of credential definitions. 21 | */ 22 | public struct CredentialsList: Codable, Equatable { 23 | 24 | /** 25 | An array of credential definitions that were created for this instance. 26 | */ 27 | public var credentials: [Credentials]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case credentials = "credentials" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/DiskUsage.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Summary of the disk usage statistics for the environment. 21 | */ 22 | public struct DiskUsage: Codable, Equatable { 23 | 24 | /** 25 | Number of bytes within the environment's disk capacity that are currently used to store data. 26 | */ 27 | public var usedBytes: Int? 28 | 29 | /** 30 | Total number of bytes available in the environment's disk capacity. 31 | */ 32 | public var maximumAllowedBytes: Int? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case usedBytes = "used_bytes" 37 | case maximumAllowedBytes = "maximum_allowed_bytes" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/EnvironmentDocuments.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Summary of the document usage statistics for the environment. 21 | */ 22 | public struct EnvironmentDocuments: Codable, Equatable { 23 | 24 | /** 25 | Number of documents indexed for the environment. 26 | */ 27 | public var available: Int? 28 | 29 | /** 30 | Total number of documents allowed in the environment's capacity. 31 | */ 32 | public var maximumAllowed: Int? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case available = "available" 37 | case maximumAllowed = "maximum_allowed" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/GatewayDelete.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Gatway deletion confirmation. 21 | */ 22 | public struct GatewayDelete: Codable, Equatable { 23 | 24 | /** 25 | The gateway ID of the deleted gateway. 26 | */ 27 | public var gatewayID: String? 28 | 29 | /** 30 | The status of the request. 31 | */ 32 | public var status: String? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case gatewayID = "gateway_id" 37 | case status = "status" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/GatewayList.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Object containing gateways array. 21 | */ 22 | public struct GatewayList: Codable, Equatable { 23 | 24 | /** 25 | Array of configured gateway connections. 26 | */ 27 | public var gateways: [Gateway]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case gateways = "gateways" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/ListCollectionsResponse.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Response object containing an array of collection details. 21 | */ 22 | public struct ListCollectionsResponse: Codable, Equatable { 23 | 24 | /** 25 | An array containing information about each collection in the environment. 26 | */ 27 | public var collections: [Collection]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case collections = "collections" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/ListConfigurationsResponse.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Object containing an array of available configurations. 21 | */ 22 | public struct ListConfigurationsResponse: Codable, Equatable { 23 | 24 | /** 25 | An array of configurations that are available for the service instance. 26 | */ 27 | public var configurations: [Configuration]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case configurations = "configurations" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/ListEnvironmentsResponse.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Response object containing an array of configured environments. 21 | */ 22 | public struct ListEnvironmentsResponse: Codable, Equatable { 23 | 24 | /** 25 | An array of [environments] that are available for the service instance. 26 | */ 27 | public var environments: [Environment]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case environments = "environments" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/LogQueryResponse.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Object containing results that match the requested **logs** query. 21 | */ 22 | public struct LogQueryResponse: Codable, Equatable { 23 | 24 | /** 25 | Number of matching results. 26 | */ 27 | public var matchingResults: Int? 28 | 29 | /** 30 | Array of log query response results. 31 | */ 32 | public var results: [LogQueryResponseResult]? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case matchingResults = "matching_results" 37 | case results = "results" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/MetricResponse.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | The response generated from a call to a **metrics** method. 21 | */ 22 | public struct MetricResponse: Codable, Equatable { 23 | 24 | /** 25 | Array of metric aggregations. 26 | */ 27 | public var aggregations: [MetricAggregation]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case aggregations = "aggregations" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/MetricTokenResponse.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | The response generated from a call to a **metrics** method that evaluates tokens. 21 | */ 22 | public struct MetricTokenResponse: Codable, Equatable { 23 | 24 | /** 25 | Array of metric token aggregations. 26 | */ 27 | public var aggregations: [MetricTokenAggregation]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case aggregations = "aggregations" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/QueryTopHitsAggregationResult.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2022. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | import IBMSwiftSDKCore 19 | 20 | /** 21 | A query response that contains the matching documents for the preceding aggregations. 22 | */ 23 | public struct QueryTopHitsAggregationResult: Codable, Equatable { 24 | 25 | /** 26 | Number of matching results. 27 | */ 28 | public var matchingResults: Int 29 | 30 | /** 31 | An array of the document results. 32 | */ 33 | public var hits: [[String: JSON]]? 34 | 35 | // Map each property name to the key that shall be used for encoding/decoding. 36 | private enum CodingKeys: String, CodingKey { 37 | case matchingResults = "matching_results" 38 | case hits = "hits" 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/SduStatusCustomFields.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Information about custom smart document understanding fields that exist in this collection. 21 | */ 22 | public struct SduStatusCustomFields: Codable, Equatable { 23 | 24 | /** 25 | The number of custom fields defined for this collection. 26 | */ 27 | public var defined: Int? 28 | 29 | /** 30 | The maximum number of custom fields that are allowed in this collection. 31 | */ 32 | public var maximumAllowed: Int? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case defined = "defined" 37 | case maximumAllowed = "maximum_allowed" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/TopHitsResults.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Top hit information for this query. 21 | */ 22 | public struct TopHitsResults: Codable, Equatable { 23 | 24 | /** 25 | Number of matching results. 26 | */ 27 | public var matchingResults: Int? 28 | 29 | /** 30 | Top results returned by the aggregation. 31 | */ 32 | public var hits: [QueryResult]? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case matchingResults = "matching_results" 37 | case hits = "hits" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Models/TrainingExampleList.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Object containing an array of training examples. 21 | */ 22 | public struct TrainingExampleList: Codable, Equatable { 23 | 24 | /** 25 | Array of training examples. 26 | */ 27 | public var examples: [TrainingExample]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case examples = "examples" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV1/Shared.swift: -------------------------------------------------------------------------------- 1 | ../SupportingFiles/Shared.swift -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/AnalyzedDocument.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | An object that contains the converted document and any identified enrichments. 21 | */ 22 | public struct AnalyzedDocument: Codable, Equatable { 23 | 24 | /** 25 | Array of document results that match the query. 26 | */ 27 | public var notices: [Notice]? 28 | 29 | /** 30 | Result of the document analysis. 31 | */ 32 | public var result: AnalyzedResult? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case notices = "notices" 37 | case result = "result" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/Collection.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | A collection for storing documents. 21 | */ 22 | public struct Collection: Codable, Equatable { 23 | 24 | /** 25 | The unique identifier of the collection. 26 | */ 27 | public var collectionID: String? 28 | 29 | /** 30 | The name of the collection. 31 | */ 32 | public var name: String? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case collectionID = "collection_id" 37 | case name = "name" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/Completions.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | An object that contains an array of autocompletion suggestions. 21 | */ 22 | public struct Completions: Codable, Equatable { 23 | 24 | /** 25 | Array of autocomplete suggestion based on the provided prefix. 26 | */ 27 | public var completions: [String]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case completions = "completions" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/ComponentSettingsFieldsShown.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Fields shown in the results section of the UI. 21 | */ 22 | public struct ComponentSettingsFieldsShown: Codable, Equatable { 23 | 24 | /** 25 | Body label. 26 | */ 27 | public var body: ComponentSettingsFieldsShownBody? 28 | 29 | /** 30 | Title label. 31 | */ 32 | public var title: ComponentSettingsFieldsShownTitle? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case body = "body" 37 | case title = "title" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/ComponentSettingsFieldsShownBody.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Body label. 21 | */ 22 | public struct ComponentSettingsFieldsShownBody: Codable, Equatable { 23 | 24 | /** 25 | Use the whole passage as the body. 26 | */ 27 | public var usePassage: Bool? 28 | 29 | /** 30 | Use a specific field as the title. 31 | */ 32 | public var field: String? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case usePassage = "use_passage" 37 | case field = "field" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/ComponentSettingsFieldsShownTitle.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Title label. 21 | */ 22 | public struct ComponentSettingsFieldsShownTitle: Codable, Equatable { 23 | 24 | /** 25 | Use a specific field as the title. 26 | */ 27 | public var field: String? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case field = "field" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/DocumentClassifierModels.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2022. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | An object that contains a list of document classifier model definitions. 21 | */ 22 | public struct DocumentClassifierModels: Codable, Equatable { 23 | 24 | /** 25 | An array of document classifier model definitions. 26 | */ 27 | public var models: [DocumentClassifierModel]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case models = "models" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/DocumentClassifiers.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2022. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | An object that contains a list of document classifier definitions. 21 | */ 22 | public struct DocumentClassifiers: Codable, Equatable { 23 | 24 | /** 25 | An array of document classifier definitions. 26 | */ 27 | public var classifiers: [DocumentClassifier]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case classifiers = "classifiers" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/Enrichments.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | An object that contains an array of enrichment definitions. 21 | */ 22 | public struct Enrichments: Codable, Equatable { 23 | 24 | /** 25 | An array of enrichment definitions. 26 | */ 27 | public var enrichments: [Enrichment]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case enrichments = "enrichments" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/ListCollectionsResponse.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Response object that contains an array of collection details. 21 | */ 22 | public struct ListCollectionsResponse: Codable, Equatable { 23 | 24 | /** 25 | An array that contains information about each collection in the project. 26 | */ 27 | public var collections: [Collection]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case collections = "collections" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/ListProjectsResponse.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | A list of projects in this instance. 21 | */ 22 | public struct ListProjectsResponse: Codable, Equatable { 23 | 24 | /** 25 | An array of project details. 26 | */ 27 | public var projects: [ProjectListDetails]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case projects = "projects" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/QueryNoticesResponse.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Object that contains notice query results. 21 | */ 22 | public struct QueryNoticesResponse: Codable, Equatable { 23 | 24 | /** 25 | The number of matching results. 26 | */ 27 | public var matchingResults: Int? 28 | 29 | /** 30 | Array of document results that match the query. 31 | */ 32 | public var notices: [Notice]? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case matchingResults = "matching_results" 37 | case notices = "notices" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/QuerySuggestedRefinement.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | A suggested additional query term or terms user to filter results. 21 | */ 22 | public struct QuerySuggestedRefinement: Codable, Equatable { 23 | 24 | /** 25 | The text used to filter. 26 | */ 27 | public var text: String? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case text = "text" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/QueryTopHitsAggregationResult.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | import IBMSwiftSDKCore 19 | 20 | /** 21 | A query response that contains the matching documents for the preceding aggregations. 22 | */ 23 | public struct QueryTopHitsAggregationResult: Codable, Equatable { 24 | 25 | /** 26 | Number of matching results. 27 | */ 28 | public var matchingResults: Int 29 | 30 | /** 31 | An array of the document results. 32 | */ 33 | public var hits: [[String: JSON]]? 34 | 35 | // Map each property name to the key that shall be used for encoding/decoding. 36 | private enum CodingKeys: String, CodingKey { 37 | case matchingResults = "matching_results" 38 | case hits = "hits" 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/TableColumnHeaderIDs.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | An array of values, each being the `id` value of a column header that is applicable to the current cell. 21 | */ 22 | public struct TableColumnHeaderIDs: Codable, Equatable { 23 | 24 | /** 25 | The `id` value of a column header. 26 | */ 27 | public var id: String? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case id = "id" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/TableColumnHeaderTexts.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | An array of values, each being the `text` value of a column header that is applicable to the current cell. 21 | */ 22 | public struct TableColumnHeaderTexts: Codable, Equatable { 23 | 24 | /** 25 | The `text` value of a column header. 26 | */ 27 | public var text: String? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case text = "text" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/TableColumnHeaderTextsNormalized.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | If you provide customization input, the normalized version of the column header texts according to the customization; 21 | otherwise, the same value as `column_header_texts`. 22 | */ 23 | public struct TableColumnHeaderTextsNormalized: Codable, Equatable { 24 | 25 | /** 26 | The normalized version of a column header text. 27 | */ 28 | public var textNormalized: String? 29 | 30 | // Map each property name to the key that shall be used for encoding/decoding. 31 | private enum CodingKeys: String, CodingKey { 32 | case textNormalized = "text_normalized" 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/TableElementLocation.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | The numeric location of the identified element in the document, represented with two integers labeled `begin` and 21 | `end`. 22 | */ 23 | public struct TableElementLocation: Codable, Equatable { 24 | 25 | /** 26 | The element's `begin` index. 27 | */ 28 | public var begin: Int 29 | 30 | /** 31 | The element's `end` index. 32 | */ 33 | public var end: Int 34 | 35 | // Map each property name to the key that shall be used for encoding/decoding. 36 | private enum CodingKeys: String, CodingKey { 37 | case begin = "begin" 38 | case end = "end" 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/TableKeyValuePairs.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Key-value pairs detected across cell boundaries. 21 | */ 22 | public struct TableKeyValuePairs: Codable, Equatable { 23 | 24 | /** 25 | A key in a key-value pair. 26 | */ 27 | public var key: TableCellKey? 28 | 29 | /** 30 | A list of values in a key-value pair. 31 | */ 32 | public var value: [TableCellValues]? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case key = "key" 37 | case value = "value" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/TableRowHeaderIDs.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | An array of values, each being the `id` value of a row header that is applicable to this body cell. 21 | */ 22 | public struct TableRowHeaderIDs: Codable, Equatable { 23 | 24 | /** 25 | The `id` values of a row header. 26 | */ 27 | public var id: String? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case id = "id" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/TableRowHeaderTexts.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | An array of values, each being the `text` value of a row header that is applicable to this body cell. 21 | */ 22 | public struct TableRowHeaderTexts: Codable, Equatable { 23 | 24 | /** 25 | The `text` value of a row header. 26 | */ 27 | public var text: String? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case text = "text" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/TableRowHeaderTextsNormalized.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | If you provide customization input, the normalized version of the row header texts according to the customization; 21 | otherwise, the same value as `row_header_texts`. 22 | */ 23 | public struct TableRowHeaderTextsNormalized: Codable, Equatable { 24 | 25 | /** 26 | The normalized version of a row header text. 27 | */ 28 | public var textNormalized: String? 29 | 30 | // Map each property name to the key that shall be used for encoding/decoding. 31 | private enum CodingKeys: String, CodingKey { 32 | case textNormalized = "text_normalized" 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/TableTextLocation.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Text and associated location within a table. 21 | */ 22 | public struct TableTextLocation: Codable, Equatable { 23 | 24 | /** 25 | The text retrieved. 26 | */ 27 | public var text: String? 28 | 29 | /** 30 | The numeric location of the identified element in the document, represented with two integers labeled `begin` and 31 | `end`. 32 | */ 33 | public var location: TableElementLocation? 34 | 35 | // Map each property name to the key that shall be used for encoding/decoding. 36 | private enum CodingKeys: String, CodingKey { 37 | case text = "text" 38 | case location = "location" 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Models/TrainingQuerySet.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Object specifying the training queries contained in the identified training set. 21 | */ 22 | public struct TrainingQuerySet: Codable, Equatable { 23 | 24 | /** 25 | Array of training queries. 26 | */ 27 | public var queries: [TrainingQuery]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case queries = "queries" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DiscoveryV2/Shared.swift: -------------------------------------------------------------------------------- 1 | ../SupportingFiles/Shared.swift -------------------------------------------------------------------------------- /Sources/LanguageTranslatorV3/Models/DeleteModelResult.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | DeleteModelResult. 21 | */ 22 | public struct DeleteModelResult: Codable, Equatable { 23 | 24 | /** 25 | "OK" indicates that the model was successfully deleted. 26 | */ 27 | public var status: String 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case status = "status" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/LanguageTranslatorV3/Models/DocumentList.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | DocumentList. 21 | */ 22 | public struct DocumentList: Codable, Equatable { 23 | 24 | /** 25 | An array of all previously submitted documents. 26 | */ 27 | public var documents: [DocumentStatus] 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case documents = "documents" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/LanguageTranslatorV3/Models/IdentifiableLanguage.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | IdentifiableLanguage. 21 | */ 22 | public struct IdentifiableLanguage: Codable, Equatable { 23 | 24 | /** 25 | The language code for an identifiable language. 26 | */ 27 | public var language: String 28 | 29 | /** 30 | The name of the identifiable language. 31 | */ 32 | public var name: String 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case language = "language" 37 | case name = "name" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/LanguageTranslatorV3/Models/IdentifiableLanguages.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | IdentifiableLanguages. 21 | */ 22 | public struct IdentifiableLanguages: Codable, Equatable { 23 | 24 | /** 25 | A list of all languages that the service can identify. 26 | */ 27 | public var languages: [IdentifiableLanguage] 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case languages = "languages" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/LanguageTranslatorV3/Models/IdentifiedLanguage.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | IdentifiedLanguage. 21 | */ 22 | public struct IdentifiedLanguage: Codable, Equatable { 23 | 24 | /** 25 | The language code for an identified language. 26 | */ 27 | public var language: String 28 | 29 | /** 30 | The confidence score for the identified language. 31 | */ 32 | public var confidence: Double 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case language = "language" 37 | case confidence = "confidence" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/LanguageTranslatorV3/Models/IdentifiedLanguages.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | IdentifiedLanguages. 21 | */ 22 | public struct IdentifiedLanguages: Codable, Equatable { 23 | 24 | /** 25 | A ranking of identified languages with confidence scores. 26 | */ 27 | public var languages: [IdentifiedLanguage] 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case languages = "languages" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/LanguageTranslatorV3/Models/Languages.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | The response type for listing supported languages. 21 | */ 22 | public struct Languages: Codable, Equatable { 23 | 24 | /** 25 | An array of supported languages with information about each language. 26 | */ 27 | public var languages: [Language] 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case languages = "languages" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/LanguageTranslatorV3/Models/Translation.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Translation. 21 | */ 22 | public struct Translation: Codable, Equatable { 23 | 24 | /** 25 | Translation output in UTF-8. 26 | */ 27 | public var translation: String 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case translation = "translation" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/LanguageTranslatorV3/Models/TranslationModels.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | The response type for listing existing translation models. 21 | */ 22 | public struct TranslationModels: Codable, Equatable { 23 | 24 | /** 25 | An array of available models. 26 | */ 27 | public var models: [TranslationModel] 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case models = "models" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/LanguageTranslatorV3/README.md: -------------------------------------------------------------------------------- 1 | # Language Translator V3 2 | 3 | * [IBM Watson Language Translator - API Reference](https://cloud.ibm.com/apidocs/language-translator?code=swift) 4 | * [IBM Watson Language Translator - Documentation](https://cloud.ibm.com/docs/language-translator/index.html) 5 | * [IBM Watson Language Translator - Service Page](https://www.ibm.com/cloud/watson-language-translator) 6 | 7 | The IBM Watson Language Translator service lets you select a domain, customize it, then identify or select the language of text, and then translate the text from one supported language to another. 8 | 9 | The following example demonstrates how to use the Language Translator service: 10 | 11 | ```swift 12 | import LanguageTranslatorV3 13 | 14 | let authenticator = WatsonIAMAuthenticator(apiKey: "{apikey}") 15 | let languageTranslator = LanguageTranslator(version: "2018-05-01", authenticator: authenticator) 16 | languageTranslator.serviceURL = "{url}" 17 | 18 | languageTranslator.translate(text: ["Hello"], modelID: "en-es") { 19 | response, error in 20 | 21 | guard let translation = response?.result else { 22 | print(error?.localizedDescription ?? "unknown error") 23 | return 24 | } 25 | 26 | print(translation) 27 | } 28 | ``` 29 | 30 | For details on all API operations, including Swift examples, [see the API reference.](https://cloud.ibm.com/apidocs/language-translator?code=swift) -------------------------------------------------------------------------------- /Sources/LanguageTranslatorV3/Shared.swift: -------------------------------------------------------------------------------- 1 | ../SupportingFiles/Shared.swift -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/Author.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2017, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | The author of the analyzed content. 21 | */ 22 | public struct Author: Codable, Equatable { 23 | 24 | /** 25 | Name of the author. 26 | */ 27 | public var name: String? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case name = "name" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/CategoriesModelList.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2021. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | List of categories models. 21 | */ 22 | public struct CategoriesModelList: Codable, Equatable { 23 | 24 | /** 25 | The categories models. 26 | */ 27 | public var models: [CategoriesModel]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case models = "models" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/CategoriesRelevantText.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Relevant text that contributed to the categorization. 21 | */ 22 | public struct CategoriesRelevantText: Codable, Equatable { 23 | 24 | /** 25 | Text from the analyzed source that supports the categorization. 26 | */ 27 | public var text: String? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case text = "text" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/ClassificationsModelList.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2021. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | List of classifications models. 21 | */ 22 | public struct ClassificationsModelList: Codable, Equatable { 23 | 24 | /** 25 | The classifications models. 26 | */ 27 | public var models: [ClassificationsModel]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case models = "models" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/ClassificationsResult.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2021. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | A classification of the analyzed text. 21 | */ 22 | public struct ClassificationsResult: Codable, Equatable { 23 | 24 | /** 25 | Classification assigned to the text. 26 | */ 27 | public var className: String? 28 | 29 | /** 30 | Confidence score for the classification. Higher values indicate greater confidence. 31 | */ 32 | public var confidence: Double? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case className = "class_name" 37 | case confidence = "confidence" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/DeleteModelResults.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Delete model results. 21 | */ 22 | public struct DeleteModelResults: Codable, Equatable { 23 | 24 | /** 25 | model_id of the deleted model. 26 | */ 27 | public var deleted: String? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case deleted = "deleted" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/DocumentEmotionResults.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2017, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Emotion results for the document as a whole. 21 | */ 22 | public struct DocumentEmotionResults: Codable, Equatable { 23 | 24 | /** 25 | Emotion results for the document as a whole. 26 | */ 27 | public var emotion: EmotionScores? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case emotion = "emotion" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/DocumentSentimentResults.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2017, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | DocumentSentimentResults. 21 | */ 22 | public struct DocumentSentimentResults: Codable, Equatable { 23 | 24 | /** 25 | Indicates whether the sentiment is positive, neutral, or negative. 26 | */ 27 | public var label: String? 28 | 29 | /** 30 | Sentiment score from -1 (negative) to 1 (positive). 31 | */ 32 | public var score: Double? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case label = "label" 37 | case score = "score" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/FeatureSentimentResults.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2017, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | FeatureSentimentResults. 21 | */ 22 | public struct FeatureSentimentResults: Codable, Equatable { 23 | 24 | /** 25 | Sentiment score from -1 (negative) to 1 (positive). 26 | */ 27 | public var score: Double? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case score = "score" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/Feed.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | RSS or ATOM feed found on the webpage. 21 | */ 22 | public struct Feed: Codable, Equatable { 23 | 24 | /** 25 | URL of the RSS or ATOM feed. 26 | */ 27 | public var link: String? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case link = "link" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/ListModelsResults.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2017, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Custom models that are available for entities and relations. 21 | */ 22 | public struct ListModelsResults: Codable, Equatable { 23 | 24 | /** 25 | An array of available models. 26 | */ 27 | public var models: [Model]? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case models = "models" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/ListSentimentModelsResponse.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2021. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | ListSentimentModelsResponse. 21 | */ 22 | public struct ListSentimentModelsResponse: Codable, Equatable { 23 | 24 | public var models: [SentimentModel]? 25 | 26 | // Map each property name to the key that shall be used for encoding/decoding. 27 | private enum CodingKeys: String, CodingKey { 28 | case models = "models" 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/Notice.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2021. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | A list of messages describing model training issues when model status is `error`. 21 | */ 22 | public struct Notice: Codable, Equatable { 23 | 24 | /** 25 | Describes deficiencies or inconsistencies in training data. 26 | */ 27 | public var message: String? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case message = "message" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/RelationEntity.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2017, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | An entity that corresponds with an argument in a relation. 21 | */ 22 | public struct RelationEntity: Codable, Equatable { 23 | 24 | /** 25 | Text that corresponds to the entity. 26 | */ 27 | public var text: String? 28 | 29 | /** 30 | Entity type. 31 | */ 32 | public var type: String? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case text = "text" 37 | case type = "type" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/SemanticRolesEntity.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2017, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | SemanticRolesEntity. 21 | */ 22 | public struct SemanticRolesEntity: Codable, Equatable { 23 | 24 | /** 25 | Entity type. 26 | */ 27 | public var type: String? 28 | 29 | /** 30 | The entity text. 31 | */ 32 | public var text: String? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case type = "type" 37 | case text = "text" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/SemanticRolesKeyword.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2017, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | SemanticRolesKeyword. 21 | */ 22 | public struct SemanticRolesKeyword: Codable, Equatable { 23 | 24 | /** 25 | The keyword text. 26 | */ 27 | public var text: String? 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case text = "text" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/SemanticRolesResultAction.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | The extracted action from the sentence. 21 | */ 22 | public struct SemanticRolesResultAction: Codable, Equatable { 23 | 24 | /** 25 | Analyzed text that corresponds to the action. 26 | */ 27 | public var text: String? 28 | 29 | /** 30 | normalized version of the action. 31 | */ 32 | public var normalized: String? 33 | 34 | public var verb: SemanticRolesVerb? 35 | 36 | // Map each property name to the key that shall be used for encoding/decoding. 37 | private enum CodingKeys: String, CodingKey { 38 | case text = "text" 39 | case normalized = "normalized" 40 | case verb = "verb" 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/SemanticRolesResultObject.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | The extracted object from the sentence. 21 | */ 22 | public struct SemanticRolesResultObject: Codable, Equatable { 23 | 24 | /** 25 | Object text. 26 | */ 27 | public var text: String? 28 | 29 | /** 30 | An array of extracted keywords. 31 | */ 32 | public var keywords: [SemanticRolesKeyword]? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case text = "text" 37 | case keywords = "keywords" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/SemanticRolesVerb.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2017, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | SemanticRolesVerb. 21 | */ 22 | public struct SemanticRolesVerb: Codable, Equatable { 23 | 24 | /** 25 | The keyword text. 26 | */ 27 | public var text: String? 28 | 29 | /** 30 | Verb tense. 31 | */ 32 | public var tense: String? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case text = "text" 37 | case tense = "tense" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/SentenceResult.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | SentenceResult. 21 | */ 22 | public struct SentenceResult: Codable, Equatable { 23 | 24 | /** 25 | The sentence. 26 | */ 27 | public var text: String? 28 | 29 | /** 30 | Character offsets indicating the beginning and end of the sentence in the analyzed text. 31 | */ 32 | public var location: [Int]? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case text = "text" 37 | case location = "location" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/SentimentResult.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2017, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | The sentiment of the content. 21 | */ 22 | public struct SentimentResult: Codable, Equatable { 23 | 24 | /** 25 | The document level sentiment. 26 | */ 27 | public var document: DocumentSentimentResults? 28 | 29 | /** 30 | The targeted sentiment to analyze. 31 | */ 32 | public var targets: [TargetedSentimentResults]? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case document = "document" 37 | case targets = "targets" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/SyntaxResult.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Tokens and sentences returned from syntax analysis. 21 | */ 22 | public struct SyntaxResult: Codable, Equatable { 23 | 24 | public var tokens: [TokenResult]? 25 | 26 | public var sentences: [SentenceResult]? 27 | 28 | // Map each property name to the key that shall be used for encoding/decoding. 29 | private enum CodingKeys: String, CodingKey { 30 | case tokens = "tokens" 31 | case sentences = "sentences" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/TargetedEmotionResults.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2017, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Emotion results for a specified target. 21 | */ 22 | public struct TargetedEmotionResults: Codable, Equatable { 23 | 24 | /** 25 | Targeted text. 26 | */ 27 | public var text: String? 28 | 29 | /** 30 | The emotion results for the target. 31 | */ 32 | public var emotion: EmotionScores? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case text = "text" 37 | case emotion = "emotion" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Models/TargetedSentimentResults.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2017, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | TargetedSentimentResults. 21 | */ 22 | public struct TargetedSentimentResults: Codable, Equatable { 23 | 24 | /** 25 | Targeted text. 26 | */ 27 | public var text: String? 28 | 29 | /** 30 | Sentiment score from -1 (negative) to 1 (positive). 31 | */ 32 | public var score: Double? 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case text = "text" 37 | case score = "score" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/NaturalLanguageUnderstandingV1/Shared.swift: -------------------------------------------------------------------------------- 1 | ../SupportingFiles/Shared.swift -------------------------------------------------------------------------------- /Sources/SpeechToTextV1/Models/AcousticModels.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Information about existing custom acoustic models. 21 | */ 22 | public struct AcousticModels: Codable, Equatable { 23 | 24 | /** 25 | An array of `AcousticModel` objects that provides information about each available custom acoustic model. The array 26 | is empty if the requesting credentials own no custom acoustic models (if no language is specified) or own no custom 27 | acoustic models for the specified language. 28 | */ 29 | public var customizations: [AcousticModel] 30 | 31 | // Map each property name to the key that shall be used for encoding/decoding. 32 | private enum CodingKeys: String, CodingKey { 33 | case customizations = "customizations" 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Sources/SpeechToTextV1/Models/Corpora.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Information about the corpora from a custom language model. 21 | */ 22 | public struct Corpora: Codable, Equatable { 23 | 24 | /** 25 | An array of `Corpus` objects that provides information about the corpora for the custom model. The array is empty 26 | if the custom model has no corpora. 27 | */ 28 | public var corpora: [Corpus] 29 | 30 | // Map each property name to the key that shall be used for encoding/decoding. 31 | private enum CodingKeys: String, CodingKey { 32 | case corpora = "corpora" 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Sources/SpeechToTextV1/Models/Grammars.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Information about the grammars from a custom language model. 21 | */ 22 | public struct Grammars: Codable, Equatable { 23 | 24 | /** 25 | An array of `Grammar` objects that provides information about the grammars for the custom model. The array is empty 26 | if the custom model has no grammars. 27 | */ 28 | public var grammars: [Grammar] 29 | 30 | // Map each property name to the key that shall be used for encoding/decoding. 31 | private enum CodingKeys: String, CodingKey { 32 | case grammars = "grammars" 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Sources/SpeechToTextV1/Models/RecognitionJobs.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Information about current asynchronous speech recognition jobs. 21 | */ 22 | public struct RecognitionJobs: Codable, Equatable { 23 | 24 | /** 25 | An array of `RecognitionJob` objects that provides the status for each of the user's current jobs. The array is 26 | empty if the user has no current jobs. 27 | */ 28 | public var recognitions: [RecognitionJob] 29 | 30 | // Map each property name to the key that shall be used for encoding/decoding. 31 | private enum CodingKeys: String, CodingKey { 32 | case recognitions = "recognitions" 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Sources/SpeechToTextV1/Models/SpeechModels.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Information about the available language models. 21 | */ 22 | public struct SpeechModels: Codable, Equatable { 23 | 24 | /** 25 | An array of `SpeechModel` objects that provides information about each available model. 26 | */ 27 | public var models: [SpeechModel] 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case models = "models" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/SpeechToTextV1/Models/WordAlternativeResult.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2016, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | An alternative hypothesis for a word from speech recognition results. 21 | */ 22 | public struct WordAlternativeResult: Codable, Equatable { 23 | 24 | /** 25 | A confidence score for the word alternative hypothesis in the range of 0.0 to 1.0. 26 | */ 27 | public var confidence: Double 28 | 29 | /** 30 | An alternative hypothesis for a word from the input audio. 31 | */ 32 | public var word: String 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case confidence = "confidence" 37 | case word = "word" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/SpeechToTextV1/Models/WordConfidence.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2016, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** The confidence of a word in a Speech to Text transcription. */ 20 | public struct WordConfidence: Codable, Equatable { 21 | 22 | /// A particular word from the transcription. 23 | public let word: String 24 | 25 | /// The confidence of the given word, between 0 and 1. 26 | public let confidence: Double 27 | 28 | /// Used internally to initialize a `WordConfidence` model from JSON. 29 | public init(from decoder: Decoder) throws { 30 | var container = try decoder.unkeyedContainer() 31 | word = try container.decode(String.self) 32 | confidence = try container.decode(Double.self) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Sources/SpeechToTextV1/Models/Words.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Information about the words from a custom language model. 21 | */ 22 | public struct Words: Codable, Equatable { 23 | 24 | /** 25 | An array of `Word` objects that provides information about each word in the custom model's words resource. The 26 | array is empty if the custom model has no words. 27 | */ 28 | public var words: [Word] 29 | 30 | // Map each property name to the key that shall be used for encoding/decoding. 31 | private enum CodingKeys: String, CodingKey { 32 | case words = "words" 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Sources/SpeechToTextV1/Shared.swift: -------------------------------------------------------------------------------- 1 | ../SupportingFiles/Shared.swift -------------------------------------------------------------------------------- /Sources/SpeechToTextV1/WebSockets/RecognitionState.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2016, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** The state of the Speech to Text service. */ 20 | internal struct RecognitionState: Decodable { 21 | 22 | /// The state of the Speech to Text service. 23 | internal let state: String 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Sources/SpeechToTextV1/WebSockets/RecognitionStop.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2016, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** Signals the end of an audio transmission to Speech to Text. */ 20 | internal struct RecognitionStop: Encodable { 21 | 22 | /// The action to perform. Must be `stop` to end the request. 23 | private let action = "stop" 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Sources/SpeechToTextV1/WebSockets/RecognizeCallback.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2019, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | public struct RecognizeCallback { 20 | /// Allows you to set up callback in application to use microphone streaming results. 21 | public init() { 22 | } 23 | 24 | /// Invoked when transcription results are received for a recognition request. 25 | public var onResults: ((SpeechRecognitionResults) -> Void)? 26 | 27 | /// Invoked when an error or warning occurs. 28 | public var onError: ((WatsonError) -> Void)? 29 | 30 | } 31 | -------------------------------------------------------------------------------- /Sources/SupportingFiles/AssistantV1.h: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | #import 18 | 19 | //! Project version number for ConversationV1. 20 | FOUNDATION_EXPORT double AssistantV1VersionNumber; 21 | 22 | //! Project version string for ConversationV1. 23 | FOUNDATION_EXPORT const unsigned char AssistantV1VersionString[]; 24 | 25 | // In this header, you should import all the public headers of your framework using statements like #import 26 | 27 | 28 | -------------------------------------------------------------------------------- /Sources/SupportingFiles/AssistantV2.h: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | #import 18 | 19 | //! Project version number for AssistantV2. 20 | FOUNDATION_EXPORT double AssistantV2VersionNumber; 21 | 22 | //! Project version string for AssistantV2. 23 | FOUNDATION_EXPORT const unsigned char AssistantV2VersionString[]; 24 | 25 | // In this header, you should import all the public headers of your framework using statements like #import 26 | 27 | 28 | -------------------------------------------------------------------------------- /Sources/SupportingFiles/Dependencies/Clibogg/module.modulemap: -------------------------------------------------------------------------------- 1 | module Clibogg [system] { 2 | header "/usr/local/opt/libogg/include/ogg/ogg.h" 3 | link "ogg" 4 | export * 5 | } -------------------------------------------------------------------------------- /Sources/SupportingFiles/Dependencies/Clibopus/module.modulemap: -------------------------------------------------------------------------------- 1 | module Clibopus [system] { 2 | header "/usr/local/opt/opus/include/opus/opus.h" 3 | header "/usr/local/opt/opus/include/opus/opus_multistream.h" 4 | link "opus" 5 | export * 6 | } -------------------------------------------------------------------------------- /Sources/SupportingFiles/Dependencies/Copustools/include/module.modulemap: -------------------------------------------------------------------------------- 1 | module Copustools [system] { 2 | header "opus_header.h" 3 | export * 4 | } 5 | -------------------------------------------------------------------------------- /Sources/SupportingFiles/Dependencies/Libraries/libogg.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/watson-developer-cloud/swift-sdk/f85f1649a1354957284def2ebd6beb4f68d8a61b/Sources/SupportingFiles/Dependencies/Libraries/libogg.a -------------------------------------------------------------------------------- /Sources/SupportingFiles/Dependencies/Libraries/libopus.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/watson-developer-cloud/swift-sdk/f85f1649a1354957284def2ebd6beb4f68d8a61b/Sources/SupportingFiles/Dependencies/Libraries/libopus.a -------------------------------------------------------------------------------- /Sources/SupportingFiles/Dependencies/Source/ogg/config_types.h: -------------------------------------------------------------------------------- 1 | #ifndef __CONFIG_TYPES_H__ 2 | #define __CONFIG_TYPES_H__ 3 | 4 | /* these are filled in by configure */ 5 | #define INCLUDE_INTTYPES_H 1 6 | #define INCLUDE_STDINT_H 1 7 | #define INCLUDE_SYS_TYPES_H 1 8 | 9 | #if INCLUDE_INTTYPES_H 10 | # include 11 | #endif 12 | #if INCLUDE_STDINT_H 13 | # include 14 | #endif 15 | #if INCLUDE_SYS_TYPES_H 16 | # include 17 | #endif 18 | 19 | typedef int16_t ogg_int16_t; 20 | typedef uint16_t ogg_uint16_t; 21 | typedef int32_t ogg_int32_t; 22 | typedef uint32_t ogg_uint32_t; 23 | typedef int64_t ogg_int64_t; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Sources/SupportingFiles/DiscoveryV1.h: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2016, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | #import 18 | 19 | //! Project version number for DiscoveryV1. 20 | FOUNDATION_EXPORT double DiscoveryV1VersionNumber; 21 | 22 | //! Project version string for DiscoveryV1. 23 | FOUNDATION_EXPORT const unsigned char DiscoveryV1VersionString[]; 24 | 25 | // In this header, you should import all the public headers of your framework using statements like #import 26 | 27 | 28 | -------------------------------------------------------------------------------- /Sources/SupportingFiles/DiscoveryV2.h: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2016, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | #import 18 | 19 | //! Project version number for DiscoveryV1. 20 | FOUNDATION_EXPORT double DiscoveryV1VersionNumber; 21 | 22 | //! Project version string for DiscoveryV1. 23 | FOUNDATION_EXPORT const unsigned char DiscoveryV1VersionString[]; 24 | 25 | // In this header, you should import all the public headers of your framework using statements like #import 26 | 27 | 28 | -------------------------------------------------------------------------------- /Sources/SupportingFiles/Info-Release.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Sources/SupportingFiles/Info-Tests.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Sources/SupportingFiles/LanguageTranslatorV3.h: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | #import 18 | 19 | //! Project version number for LanguageTranslatorV3. 20 | FOUNDATION_EXPORT double LanguageTranslatorV3VersionNumber; 21 | 22 | //! Project version string for LanguageTranslatorV3. 23 | FOUNDATION_EXPORT const unsigned char LanguageTranslatorV3VersionString[]; 24 | 25 | // In this header, you should import all the public headers of your framework using statements like #import 26 | 27 | 28 | -------------------------------------------------------------------------------- /Sources/SupportingFiles/NaturalLanguageUnderstandingV1.h: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2017, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | #import 18 | 19 | //! Project version number for NaturalLanguageUnderstandingV1. 20 | FOUNDATION_EXPORT double NaturalLanguageUnderstandingV1VersionNumber; 21 | 22 | //! Project version string for NaturalLanguageUnderstandingV1. 23 | FOUNDATION_EXPORT const unsigned char NaturalLanguageUnderstandingV1VersionString[]; 24 | 25 | // In this header, you should import all the public headers of your framework using statements like #import 26 | 27 | 28 | -------------------------------------------------------------------------------- /Sources/SupportingFiles/SpeechToTextV1.h: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2016, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | #import 18 | 19 | //! Project version number for SpeechToTextV1. 20 | FOUNDATION_EXPORT double SpeechToTextV1VersionNumber; 21 | 22 | //! Project version string for SpeechToTextV1. 23 | FOUNDATION_EXPORT const unsigned char SpeechToTextV1VersionString[]; 24 | 25 | // Import ogg and opus headers to access C code from Swift 26 | #import "ogg.h" 27 | #import "opus.h" 28 | #import "opus_multistream.h" 29 | -------------------------------------------------------------------------------- /Sources/SupportingFiles/TextToSpeechV1.h: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2016, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | #import 18 | 19 | //! Project version number for TextToSpeechV1. 20 | FOUNDATION_EXPORT double TextToSpeechV1VersionNumber; 21 | 22 | //! Project version string for TextToSpeechV1. 23 | FOUNDATION_EXPORT const unsigned char TextToSpeechV1VersionString[]; 24 | 25 | // Import ogg and opus headers to access C code from Swift 26 | #import "ogg.h" 27 | #import "opus.h" 28 | #import "opus_multistream.h" 29 | #import "opus_header.h" 30 | -------------------------------------------------------------------------------- /Sources/SupportingFiles/WatsonCredentials.swift.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/watson-developer-cloud/swift-sdk/f85f1649a1354957284def2ebd6beb4f68d8a61b/Sources/SupportingFiles/WatsonCredentials.swift.enc -------------------------------------------------------------------------------- /Sources/SupportingFiles/ibm-credentials-example.env: -------------------------------------------------------------------------------- 1 | assistant_apikey=1234abcd 2 | ASSISTANT_AUTH_TYPE=iam 3 | 4 | DISCOVERY_USERNAME=me 5 | DISCOVERY_PASSWORD=hunter2 6 | DISCOVERY_AUTH_TYPE=basic 7 | 8 | VISUAL_RECOGNITION_APIKEY=1234abcd 9 | VISUAL_RECOGNITION_URL=https://test.us-south.containers.cloud.ibm.com/visual-recognition/api 10 | VISUAL_RECOGNITION_IAM_URL=https://cloud.ibm.com/iam 11 | VISUAL_RECOGNITION_AUTH_TYPE=iam 12 | -------------------------------------------------------------------------------- /Sources/TextToSpeechV1/Models/CustomModels.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Information about existing custom models. 21 | */ 22 | public struct CustomModels: Codable, Equatable { 23 | 24 | /** 25 | An array of `CustomModel` objects that provides information about each available custom model. The array is empty 26 | if the requesting credentials own no custom models (if no language is specified) or own no custom models for the 27 | specified language. 28 | */ 29 | public var customizations: [CustomModel] 30 | 31 | // Map each property name to the key that shall be used for encoding/decoding. 32 | private enum CodingKeys: String, CodingKey { 33 | case customizations = "customizations" 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Sources/TextToSpeechV1/Models/Prompts.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2021. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Information about the custom prompts that are defined for a custom model. 21 | */ 22 | public struct Prompts: Codable, Equatable { 23 | 24 | /** 25 | An array of `Prompt` objects that provides information about the prompts that are defined for the specified custom 26 | model. The array is empty if no prompts are defined for the custom model. 27 | */ 28 | public var prompts: [Prompt] 29 | 30 | // Map each property name to the key that shall be used for encoding/decoding. 31 | private enum CodingKeys: String, CodingKey { 32 | case prompts = "prompts" 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Sources/TextToSpeechV1/Models/Pronunciation.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2016, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | The pronunciation of the specified text. 21 | */ 22 | public struct Pronunciation: Codable, Equatable { 23 | 24 | /** 25 | The pronunciation of the specified text in the requested voice and format. If a custom model is specified, the 26 | pronunciation also reflects that custom model. 27 | */ 28 | public var pronunciation: String 29 | 30 | // Map each property name to the key that shall be used for encoding/decoding. 31 | private enum CodingKeys: String, CodingKey { 32 | case pronunciation = "pronunciation" 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Sources/TextToSpeechV1/Models/Speaker.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2021. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Information about a speaker model. 21 | */ 22 | public struct Speaker: Codable, Equatable { 23 | 24 | /** 25 | The speaker ID (GUID) of the speaker. 26 | */ 27 | public var speakerID: String 28 | 29 | /** 30 | The user-defined name of the speaker. 31 | */ 32 | public var name: String 33 | 34 | // Map each property name to the key that shall be used for encoding/decoding. 35 | private enum CodingKeys: String, CodingKey { 36 | case speakerID = "speaker_id" 37 | case name = "name" 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Sources/TextToSpeechV1/Models/SpeakerModel.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2021. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | The speaker ID of the speaker model. 21 | */ 22 | public struct SpeakerModel: Codable, Equatable { 23 | 24 | /** 25 | The speaker ID (GUID) of the speaker model. 26 | */ 27 | public var speakerID: String 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case speakerID = "speaker_id" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/TextToSpeechV1/Models/Speakers.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2021. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Information about all speaker models for the service instance. 21 | */ 22 | public struct Speakers: Codable, Equatable { 23 | 24 | /** 25 | An array of `Speaker` objects that provides information about the speakers for the service instance. The array is 26 | empty if the service instance has no speakers. 27 | */ 28 | public var speakers: [Speaker] 29 | 30 | // Map each property name to the key that shall be used for encoding/decoding. 31 | private enum CodingKeys: String, CodingKey { 32 | case speakers = "speakers" 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Sources/TextToSpeechV1/Models/Voices.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) Copyright IBM Corp. 2018, 2020. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | import Foundation 18 | 19 | /** 20 | Information about all available voices. 21 | */ 22 | public struct Voices: Codable, Equatable { 23 | 24 | /** 25 | A list of available voices. 26 | */ 27 | public var voices: [Voice] 28 | 29 | // Map each property name to the key that shall be used for encoding/decoding. 30 | private enum CodingKeys: String, CodingKey { 31 | case voices = "voices" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/TextToSpeechV1/Shared.swift: -------------------------------------------------------------------------------- 1 | ../SupportingFiles/Shared.swift -------------------------------------------------------------------------------- /Tests/AssistantV1Tests/TestUtilities.swift: -------------------------------------------------------------------------------- 1 | ../TestUtilities.swift -------------------------------------------------------------------------------- /Tests/AssistantV1Tests/WatsonCredentials.swift: -------------------------------------------------------------------------------- 1 | ../../Source/SupportingFiles/WatsonCredentials.swift -------------------------------------------------------------------------------- /Tests/AssistantV2Tests/TestUtilities.swift: -------------------------------------------------------------------------------- 1 | ../../Tests/TestUtilities.swift -------------------------------------------------------------------------------- /Tests/AssistantV2Tests/WatsonCredentials.swift: -------------------------------------------------------------------------------- 1 | ../../Source/SupportingFiles/WatsonCredentials.swift -------------------------------------------------------------------------------- /Tests/DiscoveryV1Tests/Resources/discoverySample.json: -------------------------------------------------------------------------------- 1 | {"field": "data"} 2 | -------------------------------------------------------------------------------- /Tests/DiscoveryV1Tests/Resources/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "swift sdk test document", 3 | "description" : "change name to test update document function" 4 | } 5 | -------------------------------------------------------------------------------- /Tests/DiscoveryV1Tests/Resources/stopwords.txt: -------------------------------------------------------------------------------- 1 | | US English default stopword list 2 | 3 | a 4 | an 5 | and 6 | are 7 | as 8 | at 9 | be 10 | but 11 | by 12 | for 13 | if 14 | in 15 | into 16 | is 17 | it 18 | no 19 | not 20 | of 21 | on 22 | or 23 | such 24 | that 25 | the 26 | their 27 | then 28 | there 29 | these 30 | they 31 | this 32 | to 33 | was 34 | will 35 | with 36 | -------------------------------------------------------------------------------- /Tests/DiscoveryV1Tests/TestUtilities.swift: -------------------------------------------------------------------------------- 1 | ../TestUtilities.swift -------------------------------------------------------------------------------- /Tests/DiscoveryV1Tests/WatsonCredentials.swift: -------------------------------------------------------------------------------- 1 | ../../Source/SupportingFiles/WatsonCredentials.swift -------------------------------------------------------------------------------- /Tests/DiscoveryV2Tests/Resources/TestEnrichments.csv: -------------------------------------------------------------------------------- 1 | engine,gasket,carburetor,piston,valves 2 | racing,stock,open,indy,drag 3 | flag,checkered,green,caution,yellow,red 4 | -------------------------------------------------------------------------------- /Tests/DiscoveryV2Tests/Resources/analyzeDocument.json: -------------------------------------------------------------------------------- 1 | {"text": "This is an analyze json for use in the swift sdk test."} 2 | -------------------------------------------------------------------------------- /Tests/DiscoveryV2Tests/Resources/analyzeDocument.txt: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf2511 2 | \cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | {\*\expandedcolortbl;;} 5 | \margl1440\margr1440\vieww10800\viewh8400\viewkind0 6 | \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 7 | 8 | \f0\fs24 \cf0 This is a test of the analyze function.} -------------------------------------------------------------------------------- /Tests/LanguageTranslatorV3Tests/Resources/common-phrases.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/watson-developer-cloud/swift-sdk/f85f1649a1354957284def2ebd6beb4f68d8a61b/Tests/LanguageTranslatorV3Tests/Resources/common-phrases.pptx -------------------------------------------------------------------------------- /Tests/LanguageTranslatorV3Tests/Resources/glossary.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 |
7 | 8 | 9 | 10 | International Business Machines 11 | 12 | 13 | International Business Machines 14 | 15 | 16 | 17 | 18 | patent 19 | 20 | 21 | brevent 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Tests/LanguageTranslatorV3Tests/TestUtilities.swift: -------------------------------------------------------------------------------- 1 | ../TestUtilities.swift -------------------------------------------------------------------------------- /Tests/LanguageTranslatorV3Tests/WatsonCredentials.swift: -------------------------------------------------------------------------------- 1 | ../../Source/SupportingFiles/WatsonCredentials.swift -------------------------------------------------------------------------------- /Tests/LinuxMain.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | @testable import AssistantV1Tests 4 | @testable import AssistantV2Tests 5 | @testable import DiscoveryV1Tests 6 | @testable import LanguageTranslatorV3Tests 7 | @testable import NaturalLanguageUnderstandingV1Tests 8 | 9 | // the following tests are currently disabled becuase 10 | // their dependencies do not build with Swift Package Manager 11 | // @testable import TextToSpeechV1Tests 12 | // @testable import SpeechToTextV1Tests 13 | 14 | XCTMain([ 15 | testCase(AssistantTests.allTests), 16 | testCase(AssistantV1UnitTests.allTests), 17 | testCase(AssistantV2Tests.allTests), 18 | testCase(DiscoveryTests.allTests), 19 | testCase(DiscoveryUnitTests.allTests), 20 | testCase(LanguageTranslatorTests.allTests), 21 | testCase(NaturalLanguageUnderstandingTests.allTests), 22 | 23 | // the following tests are currently disabled because their 24 | // dependencies do not build with Swift Package Manager 25 | // testCase(TextToSpeechTests.allTests) 26 | // testCase(SpeechToTextTests.allTests) 27 | ]) 28 | -------------------------------------------------------------------------------- /Tests/NaturalLanguageUnderstandingV1Tests/Resources/nlu_categories_training.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "labels": [ 4 | "level1" 5 | ], 6 | "key_phrases": [ 7 | "key phrase", 8 | "key phrase 2" 9 | ] 10 | }, 11 | { 12 | "labels": [ 13 | "level1", 14 | "level2" 15 | ], 16 | "key_phrases": [ 17 | "key phrase 3", 18 | "key phrase 4" 19 | ] 20 | } 21 | ] 22 | 23 | -------------------------------------------------------------------------------- /Tests/NaturalLanguageUnderstandingV1Tests/Resources/nlu_classifications_training.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "Example 1", 4 | "labels": ["label1"] 5 | }, 6 | { 7 | "text": "Example 2", 8 | "labels": ["label1", "label2"] 9 | }, 10 | { 11 | "text": "Example 3", 12 | "labels": ["label1"] 13 | }, 14 | { 15 | "text": "Example 4", 16 | "labels": ["label1", "label2"] 17 | }, 18 | { 19 | "text": "Example 5", 20 | "labels": ["label1"] 21 | }, 22 | { 23 | "text": "Example 6", 24 | "labels": ["label1", "label2"] 25 | }, 26 | { 27 | "text": "Example 7", 28 | "labels": ["label1"] 29 | }, 30 | { 31 | "text": "Example 8", 32 | "labels": ["label1", "label2"] 33 | }, 34 | { 35 | "text": "Example 9", 36 | "labels": ["label1"] 37 | }, 38 | { 39 | "text": "Example 10", 40 | "labels": ["label1", "label2"] 41 | } 42 | ] 43 | -------------------------------------------------------------------------------- /Tests/NaturalLanguageUnderstandingV1Tests/Resources/nlu_training_data.csv: -------------------------------------------------------------------------------- 1 | doc,label 2 | Today is a great day,positive 3 | Tomorrow will be a great day,positive 4 | I am really happy,positive 5 | This is amazing,positive 6 | Wow that’s really cool,positive 7 | That looks great on you,positive 8 | This outfit is really nice,positive 9 | I think you did a great job,positive 10 | Nice work!,positive 11 | This is ok,neutral 12 | Ehh I've seen this before,neutral 13 | No comment,neutral 14 | How are you?,neutral 15 | Hello,neutral 16 | I don’t have an opinion on that subject,neutral 17 | I enjoyed it more or less,neutral 18 | This product stinks!,negative 19 | I did not have a good time,negative 20 | Worst game ever!,negative -------------------------------------------------------------------------------- /Tests/NaturalLanguageUnderstandingV1Tests/TestUtilities.swift: -------------------------------------------------------------------------------- 1 | ../TestUtilities.swift -------------------------------------------------------------------------------- /Tests/NaturalLanguageUnderstandingV1Tests/WatsonCredentials.swift: -------------------------------------------------------------------------------- 1 | ../../Source/SupportingFiles/WatsonCredentials.swift -------------------------------------------------------------------------------- /Tests/SpeechToTextV1Tests/Resources/SpeechSample.flac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/watson-developer-cloud/swift-sdk/f85f1649a1354957284def2ebd6beb4f68d8a61b/Tests/SpeechToTextV1Tests/Resources/SpeechSample.flac -------------------------------------------------------------------------------- /Tests/SpeechToTextV1Tests/Resources/SpeechSample.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/watson-developer-cloud/swift-sdk/f85f1649a1354957284def2ebd6beb4f68d8a61b/Tests/SpeechToTextV1Tests/Resources/SpeechSample.ogg -------------------------------------------------------------------------------- /Tests/SpeechToTextV1Tests/Resources/SpeechSample.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/watson-developer-cloud/swift-sdk/f85f1649a1354957284def2ebd6beb4f68d8a61b/Tests/SpeechToTextV1Tests/Resources/SpeechSample.wav -------------------------------------------------------------------------------- /Tests/SpeechToTextV1Tests/Resources/StockAnnouncement.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/watson-developer-cloud/swift-sdk/f85f1649a1354957284def2ebd6beb4f68d8a61b/Tests/SpeechToTextV1Tests/Resources/StockAnnouncement.wav -------------------------------------------------------------------------------- /Tests/SpeechToTextV1Tests/Resources/confirm.abnf: -------------------------------------------------------------------------------- 1 | #ABNF 1.0 ISO-8859-1; 2 | language en-US; 3 | mode voice; 4 | root $yesno; 5 | 6 | $yesno = affirmative | nah | no | nope | yeah | yep | yes | yup | fine 7 | | negative | OK | sure ; 8 | -------------------------------------------------------------------------------- /Tests/SpeechToTextV1Tests/TestUtilities.swift: -------------------------------------------------------------------------------- 1 | ../TestUtilities.swift -------------------------------------------------------------------------------- /Tests/SpeechToTextV1Tests/WatsonCredentials.swift: -------------------------------------------------------------------------------- 1 | ../../Source/SupportingFiles/WatsonCredentials.swift -------------------------------------------------------------------------------- /Tests/TextToSpeechV1Tests/Resources/audio.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/watson-developer-cloud/swift-sdk/f85f1649a1354957284def2ebd6beb4f68d8a61b/Tests/TextToSpeechV1Tests/Resources/audio.ogg -------------------------------------------------------------------------------- /Tests/TextToSpeechV1Tests/Resources/custom_prompt_audio.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/watson-developer-cloud/swift-sdk/f85f1649a1354957284def2ebd6beb4f68d8a61b/Tests/TextToSpeechV1Tests/Resources/custom_prompt_audio.wav -------------------------------------------------------------------------------- /Tests/TextToSpeechV1Tests/TestUtilities.swift: -------------------------------------------------------------------------------- 1 | ../TestUtilities.swift -------------------------------------------------------------------------------- /Tests/TextToSpeechV1Tests/WatsonCredentials.swift: -------------------------------------------------------------------------------- 1 | ../../Source/SupportingFiles/WatsonCredentials.swift -------------------------------------------------------------------------------- /WatsonDeveloperCloud.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WatsonDeveloperCloud.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /WatsonDeveloperCloud.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "object": { 3 | "pins": [ 4 | { 5 | "package": "Starscream", 6 | "repositoryURL": "https://github.com/daltoniam/Starscream", 7 | "state": { 8 | "branch": null, 9 | "revision": "df8d82047f6654d8e4b655d1b1525c64e1059d21", 10 | "version": "4.0.4" 11 | } 12 | }, 13 | { 14 | "package": "IBMSwiftSDKCore", 15 | "repositoryURL": "https://github.com/IBM/swift-sdk-core", 16 | "state": { 17 | "branch": null, 18 | "revision": "652ff3cc98af7adb8130863fd7de7ab1e734e795", 19 | "version": "1.2.1" 20 | } 21 | } 22 | ] 23 | }, 24 | "version": 1 25 | } 26 | -------------------------------------------------------------------------------- /docs/encrypt-credentials.md: -------------------------------------------------------------------------------- 1 | These instructions describe how to encrypt the internal `Credentials.swift` file. These credentials are required to build all test targets. 2 | 3 | By following the steps below, you will commit an encrypted version of the credentials to the repository. This makes it safely accessibly to the Travis build environment for continuous integration. 4 | 5 | #### Set Up Travis Utility 6 | 7 | 1. Install travis: `sudo gem install travis` 8 | 2. Login with travis: `travis login --org` 9 | 10 | #### Encrypt File 11 | 12 | 1. Remove current decryption command in `.travis.yml`. 13 | 2. Encrypt credentials file: `travis encrypt-file Credentials.swift` 14 | 3. Add the command generated by `travis` to `.travis.yml`. 15 | 4. Verify the `.travis.yml` build settings. You may need to update the file path (e.g. `Credentials.swift` to `Source/SupportingFiles/Credentials.swift`). 16 | 5. Verify that `Credentials.swift.enc` is encrypted. 17 | 6. Commit changes. Be careful not to accidentally commit `Credentials.swift`! 18 | -------------------------------------------------------------------------------- /docs/images/png-file-inspector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/watson-developer-cloud/swift-sdk/f85f1649a1354957284def2ebd6beb4f68d8a61b/docs/images/png-file-inspector.png --------------------------------------------------------------------------------